Permalink
Browse files

Throw catched CurlException.

  • Loading branch information...
1 parent f4f9b36 commit 2d79b9c4bc070cdf7f431622bcf51dcf2fb66611 @comel committed Apr 6, 2012
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/base_facebook.php
View
@@ -661,6 +661,11 @@ protected function getUserFromAccessToken() {
$user_info = $this->api('/me');
return $user_info['id'];
} catch (FacebookApiException $e) {
+ // Throw CURL exceptions
+ if ($e->getType() == 'CurlException') {
+ throw $e;
+ }
+
return 0;
}
}
@@ -720,6 +725,11 @@ protected function getAccessTokenFromCode($code, $redirect_uri = null) {
'redirect_uri' => $redirect_uri,
'code' => $code));
} catch (FacebookApiException $e) {
+ // Throw CURL exceptions
+ if ($e->getType() == 'CurlException') {
+ throw $e;
+ }
+
// most likely that user very recently revoked authorization.
// In any event, we don't have an access token, so say so.
return false;

0 comments on commit 2d79b9c

Please sign in to comment.