diff --git a/src/BotApi.php b/src/BotApi.php index f3fc2366..957cbba1 100644 --- a/src/BotApi.php +++ b/src/BotApi.php @@ -8,6 +8,11 @@ class BotApi { + /** + * HTTP codes + * + * @var array + */ public static $codes = array( // Informational 1xx 100 => 'Continue', @@ -58,6 +63,12 @@ class BotApi 509 => 'Bandwidth Limit Exceeded' ); + + /** + * Default http status code + */ + const DEFAULT_STATUS_CODE = 200; + /** * Url prefix */ @@ -135,7 +146,7 @@ public function call($method, array $data = null) $result = curl_exec($this->curl); - if(($httpCode = curl_getinfo($this->curl, CURLINFO_HTTP_CODE)) && $httpCode !== 200) { + if(($httpCode = curl_getinfo($this->curl, CURLINFO_HTTP_CODE)) && $httpCode !== self::DEFAULT_STATUS_CODE) { throw new HttpException(self::$codes[$httpCode], $httpCode); }