mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2025-02-06 08:19:25 +03:00
Add HTTP properties to generic error
Allows generic HTTP error to accept more detailed information about the response from the server.
This commit is contained in:
parent
57d0160b00
commit
9fe01151af
@ -1,6 +1,25 @@
|
||||
<?php
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user