diff --git a/src/MessageBird/Common/ResponseError.php b/src/MessageBird/Common/ResponseError.php index ca210d98..2b39c33d 100644 --- a/src/MessageBird/Common/ResponseError.php +++ b/src/MessageBird/Common/ResponseError.php @@ -23,6 +23,8 @@ class ResponseError const NOT_ENOUGH_CREDIT = 25; + const CHAT_API_AUTH_ERROR = 1001; + public $errors = array (); /** @@ -43,6 +45,8 @@ public function __construct($body) throw new Exceptions\BalanceException; } elseif ($error->code === self::REQUEST_NOT_ALLOWED) { throw new Exceptions\AuthenticateException; + } elseif ($error->code === self::CHAT_API_AUTH_ERROR) { + throw new Exceptions\AuthenticateException; } $this->errors[] = $error;