library/Garp/3rdParty/facebook/src/base_facebook.php
protected function throwAPIException($result) {
    $e = new FacebookApiException($result);
    switch ($e->getType()) {
      // OAuth 2.0 Draft 00 style
      case 'OAuthException':
        // OAuth 2.0 Draft 10 style
      case 'invalid_token':
        // 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) ||
            (strpos($message, 'An active access token must be used') !== false)
        ) {
          $this->destroySession();
        }
        break;
    }

    throw $e;
  }
protected function throwAPIException($result) {
    $e = new FacebookApiException($result);
    switch ($e->getType()) {
      // OAuth 2.0 Draft 00 style
      case 'OAuthException':
        // OAuth 2.0 Draft 10 style
      case 'invalid_token':
        // 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) ||
            (strpos($message, 'An active access token must be used') !== false)
        ) {
          $this->destroySession();
        }
        break;
    }

    throw $e;
  }
protected function throwAPIException ( $ result ) { $ e = new FacebookApiException ( $ result ) ; switch ( $ e -> getType ( ) ) { // OAuth 2.0 Draft 00 style case 'OAuthException' : // OAuth 2.0 Draft 10 style case 'invalid_token' : // 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 ) || ( strpos ( $ message , 'An active access token must be used' ) !== false ) ) { $ this -> destroySession ( ) ; } break ; } throw $ e ; }
Analyzes the supplied result to see if it was thrown
because the access token is no longer valid.  If that is
the case, then we destroy the session.

@param $result array A record storing the error message returned
by a failed API call.
Analyzes the supplied result to see if it was thrown because the access token is no longer valid . If that is the case then we destroy the session .