mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2024-11-25 14:26:04 +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);
|
||||
case 404:
|
||||
throw HttpClientException::notFound($response);
|
||||
case 413:
|
||||
throw HttpClientException::payloadTooLarge($response);
|
||||
case 500 <= $statusCode:
|
||||
throw HttpServerException::serverError($statusCode);
|
||||
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);
|
||||
}
|
||||
|
||||
public static function payloadTooLarge(ResponseInterface $response = null)
|
||||
{
|
||||
return new self('Payload too large, your total attachment size is too big.', 413, $response);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user