mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Formatting tools (#1172)
* Added base implementation of formatting utility * Refactored and added docs * Added changelog * Coverage
This commit is contained in:
parent
c418689dc1
commit
5b20f81654
8 changed files with 1103 additions and 47 deletions
|
|
@ -34,6 +34,8 @@ class UnsupportedKeywordArgument(DetailedAiogramError):
|
|||
|
||||
|
||||
class TelegramAPIError(DetailedAiogramError):
|
||||
label: str = "Telegram server says"
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
method: TelegramMethod[TelegramType],
|
||||
|
|
@ -44,11 +46,11 @@ class TelegramAPIError(DetailedAiogramError):
|
|||
|
||||
def __str__(self) -> str:
|
||||
original_message = super().__str__()
|
||||
return f"Telegram server says {original_message}"
|
||||
return f"{self.label} - {original_message}"
|
||||
|
||||
|
||||
class TelegramNetworkError(TelegramAPIError):
|
||||
pass
|
||||
label = "HTTP Client says"
|
||||
|
||||
|
||||
class TelegramRetryAfter(TelegramAPIError):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue