mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2024-11-29 16:36:07 +03:00
Throw more detailed generic HTTP error
Take advantage of new response code and body properties to allow better logging.
This commit is contained in:
parent
9fe01151af
commit
ba8e7bda43
@ -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{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
Loading…
Reference in New Issue
Block a user