mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
rollback unnecessary change for error attribute
This commit is contained in:
parent
b94b216685
commit
b0ab2cef65
1 changed files with 2 additions and 2 deletions
|
|
@ -15,13 +15,13 @@ If you specify errors handler for dispatcher - it will be used for all handlers
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
@router.errors(ExceptionTypeFilter(MyCustomException), F.update.message.as_("message"))
|
@router.error(ExceptionTypeFilter(MyCustomException), F.update.message.as_("message"))
|
||||||
async def handle_my_custom_exception(event: ErrorEvent, message: Message):
|
async def handle_my_custom_exception(event: ErrorEvent, message: Message):
|
||||||
# do something with error
|
# do something with error
|
||||||
await message.answer("Oops, something went wrong!")
|
await message.answer("Oops, something went wrong!")
|
||||||
|
|
||||||
|
|
||||||
@router.errors()
|
@router.error()
|
||||||
async def error_handler(event: ErrorEvent):
|
async def error_handler(event: ErrorEvent):
|
||||||
logger.critical("Critical error caused by %s", event.exception, exc_info=True)
|
logger.critical("Critical error caused by %s", event.exception, exc_info=True)
|
||||||
# do something with error
|
# do something with error
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue