Wie kann ich die Code-ID von FacebookApiException $ e erhalten?
Wie bekomme ich die Code-ID vonFacebookApiException $e
?
Ich benutze Facebook zum Posten. aber manchmal schlägt es fehl, den Inhalt zu posten. Ich verwende diese Codes unten und finde die Fehlerantwortcode-ID im Array$e
, aber alle sind geschützt, wie kann ich den Code dann bekommen?
try{
$facebook->setAccessToken($access_token);
$rs= $facebook->api('/me/feed','POST',$post_data);
} catch (FacebookApiException $e) {
print_r($e);
}
dann bekomme ich die fehlerinfo:
FacebookApiException Object
(
[result:protected] => Array
(
[error] => Array
(
[message] => Invalid OAuth access token.
[type] => OAuthException
[code] => 190 // I need this code
)
)
[message:protected] => Invalid OAuth access token.
[string:private] =>
[code:protected] => 0
[file:protected] => D:\phpnow\htdocs\laji\facebook-php-sdk\base_facebook.php
[line:protected] => 1267
[trace:private] => Array
(
[0] => Array
(
[file] => D:\phpnow\htdocs\laji\facebook-php-sdk\base_facebook.php
[line] => 876
[function] => throwAPIException
[class] => BaseFacebook
[type] => ->
[args] => Array
(
[0] => Array
(
[error] => Array
(
[message] => Invalid OAuth access token.
[type] => OAuthException
[code] => 190
)
)
)
)
[1] => Array
(
[file] => D:\phpnow\htdocs\laji\facebook-php-sdk\base_facebook.php
[line] => 650
[function] => _graph
[class] => BaseFacebook
[type] => ->
[args] => Array
(
[0] => /me/feed
[1] => POST
[2] => Array
(
[access_token] => 1CAACg13jYHp8BAP0QEOK8PwC7ZCMnSa1tAQclbRJpcNP1zQIBnB1to6etQ2wb8wiVcETDvT5dRZAUiNiZBFvt1RYgo5xUe1do4yeY5DxKIjjDBbElI8zZBBlz5yHRwigIcNYtyhHY9ZAtHL16ZAMPyo43wZANhGWE6o6EV7hXZBtxBEN24xTlGa7M
[picture] => http://imgjy.com/FPB470/m/5236e26acc73a.jpg
[link] => http://www.persunmall.com/persun/giveaway02.html?refer_id=1900
[name] => my all_prams link <name>7458
)
)
)
[2] => Array
(
[file] => D:\phpnow\htdocs\laji\fb_post.php
[line] => 98
[function] => api
[class] => BaseFacebook
[type] => ->
[args] => Array
(
[0] => Array
(
[0] => Facebook Object
(
[sharedSessionID:protected] =>
[appId:protected] => 176847305842335
[appSecret:protected] => f79311ddff5888a165d46159b06f4670
[user:protected] =>
[signedRequest:protected] =>
[state:protected] =>
[accessToken:protected] =>
[fileUploadSupport:protected] =>
[trustForwarded:protected] =>
)
[1] => _graph
)
[1] => Array
(
[0] => /me/feed
[1] => POST
[2] => Array
(
[access_token] => 1CAACg13jYHp8BAP0QEOK8PwC7ZCMnSa1tAQclbRJpcNP1zQIBnB1to6etQ2wb8wiVcETDvT5dRZAUiNiZBFvt1RYgo5xUe1do4yeY5DxKIjjDBbElI8zZBBlz5yHRwigIcNYtyhHY9ZAtHL16ZAMPyo43wZANhGWE6o6EV7hXZBtxBEN24xTlGa7M
[picture] => http://imgjy.com/FPB470/m/5236e26acc73a.jpg
[link] => http://www.persunmall.com/persun/giveaway02.html?refer_id=1900
[name] => my all_prams link <name>7458
)
)
)
)
)
)