fix(bot): wire Prometheus error tracking in error_handler
This commit is contained in:
parent
6f1df381e5
commit
b96a20d18c
1 changed files with 4 additions and 0 deletions
|
|
@ -141,7 +141,11 @@ logger = logging.getLogger("rmi_bot")
|
|||
# ══════════════════════════════════════════════
|
||||
# GLOBAL ERROR HANDLER
|
||||
# ══════════════════════════════════════════════
|
||||
from app.domains.telegram.rugmunchbot.metrics import track_error
|
||||
|
||||
|
||||
async def error_handler(update: object, ctx: ContextTypes.DEFAULT_TYPE):
|
||||
track_error("unknown", type(ctx.error).__name__)
|
||||
logger.error(f"Exception: {ctx.error}", exc_info=ctx.error)
|
||||
if isinstance(update, Update) and update.effective_message:
|
||||
with contextlib.suppress(Exception):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue