Пример #1
0
 /**
  * Overrides the exception method so that we can silently fail
  *
  * @since	5.0
  * @access	public
  * @param	string
  * @return
  */
 protected function throwAPIException($result)
 {
     $e = new EasyBlogFacebookApiException($result);
     $message = $e->getMessage();
     $exception = EB::exception($message);
     throw $exception;
     $this->error = $exception;
 }
Пример #2
0
 /**
  * Analyzes the supplied result to see if it was thrown
  * because the access token is no longer valid.  If that is
  * the case, then the persistent store is cleared.
  *
  * @param $result array A record storing the error message returned
  *                      by a failed API call.
  */
 protected function throwAPIException($result)
 {
     $e = new EasyBlogFacebookApiException($result);
     switch ($e->getType()) {
         // OAuth 2.0 Draft 00 style
         case 'OAuthException':
             // OAuth 2.0 Draft 10 style
         // OAuth 2.0 Draft 10 style
         case 'invalid_token':
             // REST server errors are just Exceptions
         // REST server errors are just Exceptions
         case 'Exception':
             $message = $e->getMessage();
             if (strpos($message, 'Error validating access token') !== false || strpos($message, 'Invalid OAuth access token') !== false) {
                 $this->setAccessToken(null);
                 $this->user = 0;
                 $this->clearAllPersistentData();
             }
     }
     throw $e;
 }