Skip to content
Discussion options

You must be logged in to vote

Because the ValueError is just a regular exception. Litestar doesn't know about it. How could Litestar infer that this ValueError has to do with input data validation and should map to a 400 response?

You can either raise ValidationError, raise a ClientError directly, or create your own exception class and register an error handler for it.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@trashdid
Comment options

Answer selected by JacobCoffee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants