mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 10:11:52 +00:00
Add new error types: ButtonURLInvalid, URLHostIsEmpty, StartParamInvalid, ButtonDataInvalid.
This commit is contained in:
parent
dc3f1b1c82
commit
c167c559d8
1 changed files with 27 additions and 2 deletions
|
|
@ -14,6 +14,10 @@ TelegramAPIError
|
|||
InvalidQueryID
|
||||
InvalidPeerID
|
||||
InvalidHTTPUrlContent
|
||||
ButtonURLInvalid
|
||||
URLHostIsEmpty
|
||||
StartParamInvalid
|
||||
ButtonDataInvalid
|
||||
WrongFileIdentifier
|
||||
GroupDeactivated
|
||||
BadWebhook
|
||||
|
|
@ -48,6 +52,8 @@ AIOGramWarning
|
|||
"""
|
||||
import time
|
||||
|
||||
# TODO: Use exceptions detector from `aiograph`.
|
||||
|
||||
_PREFIXES = ['Error: ', '[Error]: ', 'Bad Request: ', 'Conflict: ', 'Not Found: ']
|
||||
|
||||
|
||||
|
|
@ -183,6 +189,25 @@ class InvalidHTTPUrlContent(BadRequest):
|
|||
match = 'Failed to get HTTP URL content'
|
||||
|
||||
|
||||
class ButtonURLInvalid(BadRequest):
|
||||
match = 'BUTTON_URL_INVALID'
|
||||
text = 'Button URL invalid'
|
||||
|
||||
|
||||
class URLHostIsEmpty(BadRequest):
|
||||
match = 'URL host is empty'
|
||||
|
||||
|
||||
class StartParamInvalid(BadRequest):
|
||||
match = 'START_PARAM_INVALID'
|
||||
text = 'Start param invalid'
|
||||
|
||||
|
||||
class ButtonDataInvalid(BadRequest):
|
||||
match = 'BUTTON_DATA_INVALID'
|
||||
text = 'Button data invalid'
|
||||
|
||||
|
||||
class WrongFileIdentifier(BadRequest):
|
||||
match = 'wrong file identifier/HTTP URL specified'
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue