1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

fix error logs

This commit is contained in:
Steffo 2017-03-26 12:02:59 +02:00
parent 404bda88f4
commit e61d675693

View file

@ -141,7 +141,8 @@ class Bot:
async with session.request("GET", f"https://api.telegram.org/bot{token}/{endpoint}", params=params) as response: async with session.request("GET", f"https://api.telegram.org/bot{token}/{endpoint}", params=params) as response:
# Check for errors in the request # Check for errors in the request
if response.status != 200: if response.status != 200:
raise TelegramAPIError(f"Request returned {response.status} {response.reason}\n{response.text()}") error = await response.text()
raise TelegramAPIError(f"Request returned {response.status} {response.reason}\n{error}")
# Parse the json data as soon it's ready # Parse the json data as soon it's ready
data = await response.json() data = await response.json()
# Check for errors in the response # Check for errors in the response