-
How do I get the server to show my application exceptions in development? I guess I figured that's what the debug flag is for, but it still just logs out a 500 when debug is enabled. |
Beta Was this translation helpful? Give feedback.
Answered by
scott2b
Nov 9, 2022
Replies: 1 comment 2 replies
-
Ok, I see now that debug sends the stack trace as the payload to the client. So, e.g. with httpx, you can get this from the text property of the response. And, I guess, if really needed, you can raise the exception on the server with an after_exception handler like: async def after_exception_handler(exc: Exception, scope: "Scope", state: "State") -> None:
raise Exception
...
app = Starlite(after_exception=after_exception_handler .... |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
provinzkraut
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ok, I see now that debug sends the stack trace as the payload to the client. So, e.g. with httpx, you can get this from the text property of the response.
And, I guess, if really needed, you can raise the exception on the server with an after_exception handler like: