如何解决Facebook的致命错误:未捕获的CurlException问题 [英] how to fix a facebook Fatal error: Uncaught CurlException problem
问题描述
我得到这个错误来自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屋!