fix: FormData not JSON serializable in validation handler, dashboard log to INFO
This commit is contained in:
@@ -62,11 +62,14 @@ async def validation_exception_handler(
|
||||
request: Request, exc: RequestValidationError
|
||||
):
|
||||
logger.warning("Validation error: {}", exc.errors())
|
||||
body = exc.body
|
||||
if body is not None and not isinstance(body, (dict, list, str, int, float, bool, type(None))):
|
||||
body = str(body)
|
||||
return JSONResponse(
|
||||
status_code=422,
|
||||
content={
|
||||
"detail": exc.errors(),
|
||||
"body": exc.body,
|
||||
"body": body,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user