Difference between HTTPException and Response #2567
-
Is there any difference between |
Beta Was this translation helpful? Give feedback.
Answered by
hasansezertasan
May 30, 2024
Replies: 1 comment
-
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. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Kludex
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.