Created
February 19, 2021 17:30
-
-
Save Montgoner/d64d81bc4c8b301f7eb4ef8b85d73184 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async def request_validation_exception_handler(request: Request, exc: RequestValidationError) -> JSONResponse: | |
return JSONResponse( | |
status_code=HTTP_422_UNPROCESSABLE_ENTITY, | |
content={ | |
"error_name": exc.__class__.__name__, | |
"message": jsonable_encoder(exc.errors()), | |
}, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment