From ba8e7bda43c35af93bc84ea525f552eceb2e0d3f Mon Sep 17 00:00:00 2001 From: Nathan Perkins Date: Mon, 16 Jun 2014 10:40:18 -0400 Subject: [PATCH] Throw more detailed generic HTTP error Take advantage of new response code and body properties to allow better logging. --- src/Mailgun/Connection/RestClient.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mailgun/Connection/RestClient.php b/src/Mailgun/Connection/RestClient.php index 88bd574..7627fa0 100644 --- a/src/Mailgun/Connection/RestClient.php +++ b/src/Mailgun/Connection/RestClient.php @@ -131,7 +131,7 @@ class RestClient{ throw new MissingEndpoint(EXCEPTION_MISSING_ENDPOINT); } else{ - throw new GenericHTTPError(EXCEPTION_GENERIC_HTTP_ERROR); + throw new GenericHTTPError(EXCEPTION_GENERIC_HTTP_ERROR, $httpResponseCode, $responseObj->getBody()); } $result->http_response_code = $httpResponseCode; return $result; @@ -147,4 +147,4 @@ class RestClient{ } } -?> \ No newline at end of file +?>