Small changes in exceptions.

This commit is contained in:
Alex Root Junior 2017-08-14 22:16:41 +03:00
parent afe8b24c42
commit b7bf22bb77
2 changed files with 5 additions and 4 deletions

View file

@ -143,7 +143,7 @@ async def request(session, token, method, data=None, files=None, continue_retry=
async with session.post(url, data=data, **kwargs) as response:
return await _check_result(method, response)
except aiohttp.ClientError as e:
raise TelegramAPIError(f"aiohttp client throws an error: {e.__class__.__name__}: {e}")
raise NetworkError(f"aiohttp client throws an error: {e.__class__.__name__}: {e}")
except RetryAfter as e:
if continue_retry:
await asyncio.sleep(e.timeout)