dongzanghong4379 2011-01-06 10:25
浏览 31
已采纳

PHP Facebook类:如何顶级致命错误?

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 FacebookApiException($result);
  • 写回答

1条回答 默认 最新

  • doufu9145 2011-01-06 10:31
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型
  • ¥50 buildozer打包kivy app失败
  • ¥30 在vs2022里运行python代码
  • ¥15 不同尺寸货物如何寻找合适的包装箱型谱
  • ¥15 求解 yolo算法问题
  • ¥15 虚拟机打包apk出现错误
  • ¥15 用visual studi code完成html页面
  • ¥15 聚类分析或者python进行数据分析
  • ¥15 三菱伺服电机按启动按钮有使能但不动作