mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2025-02-16 21:13:12 +03:00
413 error proper handle.
This commit is contained in:
parent
ef3dc6b8bf
commit
e28065fe2e
@ -95,6 +95,8 @@ abstract class HttpApi
|
|||||||
throw HttpClientException::requestFailed($response);
|
throw HttpClientException::requestFailed($response);
|
||||||
case 404:
|
case 404:
|
||||||
throw HttpClientException::notFound($response);
|
throw HttpClientException::notFound($response);
|
||||||
|
case 413:
|
||||||
|
throw HttpClientException::payloadTooLarge($response);
|
||||||
case 500 <= $statusCode:
|
case 500 <= $statusCode:
|
||||||
throw HttpServerException::serverError($statusCode);
|
throw HttpServerException::serverError($statusCode);
|
||||||
default:
|
default:
|
||||||
|
@ -73,6 +73,11 @@ final class HttpClientException extends \RuntimeException implements Exception
|
|||||||
return new self('The endpoint you have tried to access does not exist. Check if the domain matches the domain you have configure on Mailgun.', 404, $response);
|
return new self('The endpoint you have tried to access does not exist. Check if the domain matches the domain you have configure on Mailgun.', 404, $response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function payloadTooLarge(ResponseInterface $response = null)
|
||||||
|
{
|
||||||
|
return new self('Payload too large, your total attachment size is too big.', 413, $response);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return ResponseInterface
|
* @return ResponseInterface
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user