mirror of
https://github.com/dataelement/bisheng.git
synced 2026-09-24 23:19:52 +08:00
fix: control error message length
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user