Quota Exceded exception

This commit is contained in:
Javier Hernández Gil committed 2014-04-08 21:02:08 +02:00
1 parent 661df5ac9e
commit 734e4f61a8
2 files changed
+16 -1

No files matched your search

@@ -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 {
}
+5 -1
View File
@@ -1,6 +1,7 @@
<?php
namespace Jhg\NexmoBundle\NexmoClient;
use Jhg\NexmoBundle\NexmoClient\Exceptions\QuotaExcededException;
use Jhg\NexmoBundle\NexmoClient\Exceptions\UnroutableSmsMessageException;
class NexmoClient {
@@ -105,8 +106,11 @@ class NexmoClient {
case 6:
throw new UnroutableSmsMessageException();
case 9:
throw new QuotaExcededException();
default:
throw new \Exception($response['messages'][0]['error-text']);
throw new \Exception($response['messages'][0]['error-text'],(int)$response['messages'][0]['status']);
}
}