Skip to content

Commit

Permalink
sanity check hydration
Browse files Browse the repository at this point in the history
  • Loading branch information
TomK committed Jul 23, 2015
1 parent d40e107 commit e5d5dad
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Response/ResponseBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ public static function create(ApiCallData $data)
$code = 500;
}
$exception = new $type($data->getStatusMessage(), $code);
Objects::hydrate($exception, $data->getRawResult());
$rawData = $data->getRawResult();
if(is_object($rawData))
{
Objects::hydrate($exception, $rawData);
}
throw $exception;
}
else if(in_array(
Expand Down

0 comments on commit e5d5dad

Please sign in to comment.