mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-06 07:50:32 +00:00
Update a warning message in dispatcher (#1269)
* Update a warning message in dispatcher Enhanced the warning message in aiogram/dispatcher/dispatcher.py to include a JSON dump of the update. This change helps to give clearer and more detailed information on why an update type is unknown by including the specifics of what the update contains. * Added changelog
This commit is contained in:
parent
2093b45799
commit
d0d0ff1be0
2 changed files with 3 additions and 1 deletions
1
CHANGES/1269.misc.rst
Normal file
1
CHANGES/1269.misc.rst
Normal file
|
|
@ -0,0 +1 @@
|
|||
Enhanced the warning message in dispatcher to include a JSON dump of the update when update type is not known.
|
||||
|
|
@ -264,7 +264,8 @@ class Dispatcher(Router):
|
|||
warnings.warn(
|
||||
"Detected unknown update type.\n"
|
||||
"Seems like Telegram Bot API was updated and you have "
|
||||
"installed not latest version of aiogram framework",
|
||||
"installed not latest version of aiogram framework"
|
||||
f"\nUpdate: {update.model_dump_json(exclude_unset=True)}",
|
||||
RuntimeWarning,
|
||||
)
|
||||
raise SkipHandler() from e
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue