4
我有以下錯誤。我該如何捕捉這個錯誤?未捕獲的OAuthException - 如何捕獲此錯誤?
Fatal error: Uncaught OAuthException: Error validating access token: User 638720122 has not authorized application 207445576002891. thrown in /var/www/clients/client1/web12/web/socialmediaping/fblibrary/base_facebook.php on line 1039
我有下面的代碼片段,我相信我會嘗試管理錯誤。
// Attempt to query the graph:
$graph_url = "https://graph.facebook.com/me?"
. "access_token=" . $access_token;
$response = curl_get_file_contents($graph_url);
$decoded_response = json_decode($response);
//Check for errors
if ($decoded_response->error) {
$facebookAuth = FALSE;
}
再往下我將用戶重定向到Facebook來authoise如果$ facebookAuth == false,但此心不是工作,所以我應該怎麼做?
非常感謝您的幫助。