aiogram/aiogram/exceptions.py

12 lines
341 B
Python
Raw Normal View History

2017-05-19 21:20:59 +03:00
class ValidationError(Exception):
pass
class TelegramAPIError(Exception):
def __init__(self, message, method, status, body):
super(TelegramAPIError, self).__init__(
2017-06-02 03:01:28 +03:00
f"A request to the Telegram API was unsuccessful.\n{message}")
2017-05-19 21:20:59 +03:00
self.method = method
self.status = status
self.body = body