mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2025-02-19 06:13:15 +03:00
27 lines
753 B
PHP
27 lines
753 B
PHP
|
<?php
|
||
|
|
||
|
namespace Mailgun\Exception;
|
||
|
|
||
|
use Mailgun\Exception;
|
||
|
|
||
|
/**
|
||
|
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
|
||
|
*/
|
||
|
class HttpServerException extends \RuntimeException implements Exception
|
||
|
{
|
||
|
public static function serverError($httpStatus = 500)
|
||
|
{
|
||
|
return new self('An unexpected error occurred at Mailgun\'s servers. Try again later and contact support of the error sill exists.', $httpStatus);
|
||
|
}
|
||
|
|
||
|
public static function networkError(\Exception $previous)
|
||
|
{
|
||
|
return new self('Mailgun\'s servers was unreachable.', 0, $previous);
|
||
|
}
|
||
|
|
||
|
public static function unknownHttpResponseCode($code)
|
||
|
{
|
||
|
return new self(sprintf('Unknown HTTP response code ("%d") received from the API server', $code));
|
||
|
}
|
||
|
}
|