开发者

PHP Facebook Class: how top block fatal errors?

I am using FB Connect and the PHP class called Facebook, that is provided by FB. Whenever something goes wrong FB throws Fatal Error and application dies. That's great for testing but now very nice for production code. I've looked through code and can't find a way to disable that but may be I overlooked something. So, is there any way to disable fatal errors other than looking through their class and removing every line like this

throw new FacebookApiE开发者_开发百科xception($result);


You should catch exceptions, not remove them.

try {
  //do something with the facebook api
}
catch (FacebookApiException $e) {
  //an error occured, handle it
}

And btw: fatal errors are different from exceptions.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜