From 217680f0ec531a06c68fe3164fc0cb6b7287e745 Mon Sep 17 00:00:00 2001 From: aitbc Date: Sun, 3 May 2026 23:00:35 +0200 Subject: [PATCH] fix: remove all keyword args from logger.error in error_handler Changed logger.error to use simple string format instead of keyword arguments to avoid Logger._log() errors completely. --- aitbc/middleware/error_handler.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/aitbc/middleware/error_handler.py b/aitbc/middleware/error_handler.py index c5c7f03a..2b2da443 100644 --- a/aitbc/middleware/error_handler.py +++ b/aitbc/middleware/error_handler.py @@ -41,13 +41,7 @@ class ErrorHandlerMiddleware(BaseHTTPMiddleware): }, ) except Exception as e: - logger.error( - "Unhandled exception", - exc=str(e), - path=request.url.path, - method=request.method, - exc_info=True, - ) + logger.error(f"Unhandled exception: {e} at {request.url.path}") return JSONResponse( status_code=500, content={