mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2025-02-06 08:19:25 +03:00
Merge branch 'master' of https://github.com/nathanntg/mailgun-php into nathanntg-master
Conflicts: src/Mailgun/Connection/Exceptions/GenericHTTPError.php
This commit is contained in:
commit
59299b7fbf
@ -1,4 +1,25 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Mailgun\Connection\Exceptions;
|
namespace Mailgun\Connection\Exceptions;
|
||||||
|
|
||||||
class GenericHTTPError extends \Exception{}
|
class GenericHTTPError extends \Exception
|
||||||
|
{
|
||||||
|
protected $httpResponseCode;
|
||||||
|
protected $httpResponseBody;
|
||||||
|
|
||||||
|
public function __construct($message=null, $response_code=null, $response_body=null, $code=0, \Exception $previous=null) {
|
||||||
|
parent::__construct($message, $code, $previous);
|
||||||
|
|
||||||
|
$this->httpResponseCode = $response_code;
|
||||||
|
$this->httpResponseBody = $response_body;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getHttpResponseCode() {
|
||||||
|
return $this->httpResponseCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getHttpResponseBody() {
|
||||||
|
return $this->httpResponseBody;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user