fix(bot): wire Prometheus error tracking in error_handler

This commit is contained in:
Crypto Rug Munch 2026-07-08 15:45:32 +07:00
parent 6f1df381e5
commit b96a20d18c

View file

@ -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):