开发者

PHP Facebook Class: how top block fatal errors?

开发者 https://www.devze.com 2023-02-03 07:44 出处:网络
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 f

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

精彩评论

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