如何解决Facebook的致命错误:未捕获的CurlException问题 [英] how to fix a facebook Fatal error: Uncaught CurlException problem

查看:245
本文介绍了如何解决Facebook的致命错误:未捕获的CurlException问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到这个错误来自Facebook的到来,不时:

I've got this error coming from facebook, from time to time:

致命错误:未捕获CurlException:28:connect()的超时!抛出/var/www/html/xxx/facebook/src/facebook.php线614

它打破了我的网站。

这是从facebook.php的code

this is the code from facebook.php

if ($result === false) {
  $e = new FacebookApiException(array(
    'error_code' => curl_errno($ch),
    'error'      => array(
      'message' => curl_error($ch),
      'type'    => 'CurlException',
    ),
  ));
  curl_close($ch);
  throw $e;
}

是有办法解决这一问题?或者在租赁正常降级?
谢谢

is there a way to fix this? or at lease to degrade gracefully ? thanks

我想到arr中一个返回false; 如果 $结果===真正
但我不知道这是否会解决它。

i am thinking to arr a return false; if the $result === true but i don't know if that will fix it

推荐答案

捕获异常,避免直接致命错误杀,但你仍然需要
调整为不被使用Facebook数据。请参见 http://www.php.net/catch

Catch the exception to avoid the immediate Fatal Error kill, but you still need to adjust to facebook data not being available. See http://www.php.net/catch

try {
    // facebook code
} catch (Exception $e) {
    // maybe something more graceful...
    echo 'Caught exception: ',  $e->getMessage(), "\n";
}
// regular execution continues.

这篇关于如何解决Facebook的致命错误:未捕获的CurlException问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆