From 8fa77f5026e2eed89d213ce89be98244d36604e1 Mon Sep 17 00:00:00 2001 From: GuoQing Zhang Date: Wed, 11 Dec 2024 18:14:29 +0800 Subject: [PATCH] fix: control error message length --- src/backend/bisheng/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/bisheng/main.py b/src/backend/bisheng/main.py index 9baa756b9..4143a79a3 100644 --- a/src/backend/bisheng/main.py +++ b/src/backend/bisheng/main.py @@ -35,7 +35,7 @@ def handle_http_exception(req: Request, exc: Exception) -> ORJSONResponse: def handle_request_validation_error(req: Request, exc: RequestValidationError) -> ORJSONResponse: msg = {'status_code': status.HTTP_422_UNPROCESSABLE_ENTITY, 'status_message': exc.errors()} - logger.error(f'{req.method} {req.url} {exc.errors()} {exc.body}') + logger.error(f'{req.method} {req.url} {str(exc.errors())[:100]}') return ORJSONResponse(content=msg)