1. $json_response = json_decode($response['body']);
  2. if (is_object($json_response) and property_exists($json_response, 'error')) {
  3.         throw new FacebookUnexpectedErrorException((is_object($json_response->error) and property_exists($json_response->error, 'message')) ? $json_response->error->message : '');
  4. }