Quota Exceded exception
This commit is contained in:
parent
661df5ac9e
commit
734e4f61a8
11
NexmoClient/Exceptions/QuotaExcededException.php
Normal file
11
NexmoClient/Exceptions/QuotaExcededException.php
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<?php
|
||||||
|
namespace Jhg\NexmoBundle\NexmoClient\Exceptions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class QuotaExcededException
|
||||||
|
* @package Jhg\NexmoBundle\NexmoClient\Exceptions
|
||||||
|
* @author Javi Hernández <javibilboweb@gmail.com>
|
||||||
|
*/
|
||||||
|
class QuotaExcededException extends \Exception {
|
||||||
|
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
namespace Jhg\NexmoBundle\NexmoClient;
|
namespace Jhg\NexmoBundle\NexmoClient;
|
||||||
|
|
||||||
|
use Jhg\NexmoBundle\NexmoClient\Exceptions\QuotaExcededException;
|
||||||
use Jhg\NexmoBundle\NexmoClient\Exceptions\UnroutableSmsMessageException;
|
use Jhg\NexmoBundle\NexmoClient\Exceptions\UnroutableSmsMessageException;
|
||||||
|
|
||||||
class NexmoClient {
|
class NexmoClient {
|
||||||
|
@ -105,8 +106,11 @@ class NexmoClient {
|
||||||
case 6:
|
case 6:
|
||||||
throw new UnroutableSmsMessageException();
|
throw new UnroutableSmsMessageException();
|
||||||
|
|
||||||
|
case 9:
|
||||||
|
throw new QuotaExcededException();
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new \Exception($response['messages'][0]['error-text']);
|
throw new \Exception($response['messages'][0]['error-text'],(int)$response['messages'][0]['status']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user