mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Update apihelper.py
This commit is contained in:
parent
c17a2379ba
commit
1bb98483c2
@ -127,14 +127,15 @@ def _check_result(method_name, result):
|
|||||||
try:
|
try:
|
||||||
result_json = result.json()
|
result_json = result.json()
|
||||||
except:
|
except:
|
||||||
raise ApiInvalidJSONException(method_name, result)
|
if result.status_code != 200:
|
||||||
|
raise ApiHTTPException(method_name, result)
|
||||||
|
else:
|
||||||
|
raise ApiInvalidJSONException(method_name, result)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if not result_json['ok']:
|
if not result_json['ok']:
|
||||||
raise ApiTelegramException(method_name, result, result_json)
|
raise ApiTelegramException(method_name, result, result_json)
|
||||||
|
|
||||||
elif result.status_code != 200:
|
|
||||||
raise ApiHTTPException(method_name, result)
|
|
||||||
|
|
||||||
return result_json
|
return result_json
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user