代码之家  ›  专栏  ›  技术社区  ›  user213154

FaceBookRestClientException的文档

  •  0
  • user213154  · 技术社区  · 16 年前

    使用facebook rest api php客户端库,将调用包装在 try{} 因此:

    require('facebook.php');
    $fb = new Facebook($fbApiKey, $fbSecret);
    try {
        $result = $fb->api_client->some_api_method(...);
    } catch (FacebookRestClientException $e) {
        // now what?
    }
    

    但我不知道该如何处理这个异常,例如,找出出错的地方或向错误日志中写入合理的消息。是否有这些例外的文档?

    1 回复  |  直到 16 年前
        1
  •  0
  •   user213154    16 年前

    在检查了代码和一些示例异常之后,我认为 $e 物体看起来像这样:

    (
      [message:protected] => An error message string
      [string:Exception:private] => Don't know
      [code:protected] => A numerical error code
      [file:protected] => File here the exception was thrown
      [line:protected] => Line where the exception was thrown
      [trace:Exception:private] => A PHP debug_backtrace() result
      [previous:Exception:private] => Don't know
    )
    
    推荐文章