Formatting tools (#1172)

* Added base implementation of formatting utility

* Refactored and added docs

* Added changelog

* Coverage
This commit is contained in:
Alex Root Junior 2023-06-10 20:47:45 +03:00 committed by GitHub
parent c418689dc1
commit 5b20f81654
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 1103 additions and 47 deletions

View file

@ -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):