aboutsummaryrefslogtreecommitdiff
path: root/handlers/all.py
blob: 6661f47608e54b14ddbf07e4ed86c704906ea039 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from shared.instances import dp
from aiogram import types as t


@dp.errors_handler()
async def errors_handler(upd: t.Update, err: Exception):
    txt = "Я хз что произошло, но да \n"
    txt += f"   {err.__class__.__name__}: {' '.join(map(str, err.args))}"

    if upd.message:
        await upd.message.answer(txt)
    elif upd.callback_query:
        await upd.callback_query.answer(txt)
    else:
        return
    return True