Throw more detailed generic HTTP error

Take advantage of new response code and body properties to allow better logging.
This commit is contained in:
Nathan Perkins 2014-06-16 10:40:18 -04:00
parent 9fe01151af
commit ba8e7bda43

View File

@ -131,7 +131,7 @@ class RestClient{
throw new MissingEndpoint(EXCEPTION_MISSING_ENDPOINT); throw new MissingEndpoint(EXCEPTION_MISSING_ENDPOINT);
} }
else{ else{
throw new GenericHTTPError(EXCEPTION_GENERIC_HTTP_ERROR); throw new GenericHTTPError(EXCEPTION_GENERIC_HTTP_ERROR, $httpResponseCode, $responseObj->getBody());
} }
$result->http_response_code = $httpResponseCode; $result->http_response_code = $httpResponseCode;
return $result; return $result;
@ -147,4 +147,4 @@ class RestClient{
} }
} }
?> ?>