fix: control error message length

This commit is contained in:
GuoQing Zhang
2024-12-11 18:14:29 +08:00
parent d2cff84373
commit 8fa77f5026
+1 -1
View File
@@ -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)