Skip to content

Difference between HTTPException and Response #2567

Answered by hasansezertasan
riwu asked this question in Q&A
Discussion options

You must be logged in to vote

Simply, the response with status code would return directly, raised errors would get caught by error handlers.

I'd go with returning a custom response that describes what went wrong instead of raising an error.

Or I would write an exception handler that caughts the exception and returns a custom response that describes what went wrong.

I believe it's just a design decision you need to make.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Kludex
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