mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Update method name in docs for error handling
This commit is contained in:
parent
168867ec65
commit
b94b216685
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
|
||||
|
||||
@router.error(ExceptionTypeFilter(MyCustomException), F.update.message.as_("message"))
|
||||
@router.errors(ExceptionTypeFilter(MyCustomException), F.update.message.as_("message"))
|
||||
async def handle_my_custom_exception(event: ErrorEvent, message: Message):
|
||||
# do something with error
|
||||
await message.answer("Oops, something went wrong!")
|
||||
|
||||
|
||||
@router.error()
|
||||
@router.errors()
|
||||
async def error_handler(event: ErrorEvent):
|
||||
logger.critical("Critical error caused by %s", event.exception, exc_info=True)
|
||||
# do something with error
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue