/**
  * Creates a FacebookResponseException.
  *
  * @param string $rawResponse The raw response from the Graph API
  * @param array $responseData The decoded response from the Graph API
  * @param int $statusCode
  */
 public function __construct($rawResponse, $responseData, $statusCode)
 {
     $this->rawResponse = $rawResponse;
     $this->statusCode = $statusCode;
     $this->responseData = self::convertToArray($responseData);
     parent::__construct($this->get('message', 'Unknown Exception'), $this->get('code', -1), null);
 }
Ejemplo n.º 2
0
 /**
  * Creates a FacebookResponseException.
  *
  * @param FacebookResponse     $response          The response that threw the exception.
  * @param FacebookSDKException $previousException The more detailed exception.
  */
 public function __construct(FacebookResponse $response, FacebookSDKException $previousException = null)
 {
     $this->response = $response;
     $this->responseData = $response->getDecodedBody();
     $errorMessage = $this->get('message', 'Unknown error from Graph.');
     $errorCode = $this->get('code', -1);
     parent::__construct($errorMessage, $errorCode, $previousException);
 }