From b8f9a630fccca9536ee8a8f5cdc48d6fc4bcb17f Mon Sep 17 00:00:00 2001 From: Friedrich Lindenberg Date: Wed, 17 Jul 2024 15:30:35 +0200 Subject: [PATCH] log only server-side errors --- yente/app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yente/app.py b/yente/app.py index 3d18322f..24d61262 100644 --- a/yente/app.py +++ b/yente/app.py @@ -79,7 +79,8 @@ async def request_middleware( async def yente_error_handler(req: Request, exc: YenteError) -> Response: - log.exception(f"App error {exc.status}: {exc.detail}") + if exc.status > 499: + log.exception(f"App error {exc.status}: {exc.detail}") return JSONResponse(status_code=exc.status, content={"detail": exc.detail})