mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2025-02-16 21:13:12 +03:00
Fixed an issue with Exception handling.
This commit is contained in:
parent
56b5057f9a
commit
f8babb0541
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
namespace Mailgun\Connection\Exceptions;
|
||||
|
||||
class MissingRequiredMIMEParameters extends \Exception{}
|
||||
|
||||
?>
|
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
namespace Mailgun\Connection\Exceptions;
|
||||
|
||||
class MissingRequiredParameters extends \Exception{}
|
||||
|
||||
?>
|
@ -8,7 +8,7 @@ use Mailgun\MailgunClient;
|
||||
use Mailgun\Connection\Exceptions\GenericHTTPError;
|
||||
use Mailgun\Connection\Exceptions\InvalidCredentials;
|
||||
use Mailgun\Connection\Exceptions\NoDomainsConfigured;
|
||||
use Mailgun\Connection\Exceptions\MissingRequiredMIMEParameters;
|
||||
use Mailgun\Connection\Exceptions\MissingRequiredParameters;
|
||||
use Mailgun\Connection\Exceptions\MissingEndpoint;
|
||||
|
||||
/*
|
||||
@ -83,7 +83,7 @@ class RestClient{
|
||||
$result->http_response_body = $jsonResponseData;
|
||||
}
|
||||
elseif($httpResponeCode == 400){
|
||||
throw new MissingRequiredMIMEParameters(EXCEPTION_MISSING_REQUIRED_MIME_PARAMETERS);
|
||||
throw new MissingRequiredParameters(EXCEPTION_MISSING_REQUIRED_PARAMETERS);
|
||||
}
|
||||
elseif($httpResponeCode == 401){
|
||||
throw new InvalidCredentials(EXCEPTION_INVALID_CREDENTIALS);
|
||||
|
@ -10,7 +10,7 @@ const TAG_LIMIT = 3;
|
||||
//Common Exception Messages
|
||||
const EXCEPTION_INVALID_CREDENTIALS = "Your credentials are incorrect.";
|
||||
const EXCEPTION_GENERIC_HTTP_ERROR = "An HTTP Error has occurred! Check your network connection and try again.";
|
||||
const EXCEPTION_MISSING_REQUIRED_MIME_PARAMETERS = "The parameters passed to the API were invalid. This might be a bug! Notify support@mailgun.com.";
|
||||
const EXCEPTION_MISSING_REQUIRED_PARAMETERS = "The parameters passed to the API were invalid. This might be a bug! Notify support@mailgun.com.";
|
||||
const EXCEPTION_MISSING_ENDPOINT = "The endpoint you've tried to access does not exist. This might be a bug! Notify support@mailgun.com.";
|
||||
const TOO_MANY_RECIPIENTS = "You've exceeded the maximum recipient count (1,000) on the to field with autosend disabled.";
|
||||
const INVALID_PARAMETER_NON_ARRAY = "The parameter you've passed in position 2 must be an array.";
|
||||
|
Loading…
x
Reference in New Issue
Block a user