-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception response handler doesn't catch exceptions #981
Comments
This defeats the purpose of streaming responses, so at least not all responses should do this. The question here would be, is |
I recommend to specify |
@kazu-yamamoto I think @omcnoe is referring to user code in the application. And using And that also doesn't do any forcing to NF of values you get from external libraries, so that will probably not even fix this entirely. 🤔 |
I know many Haskellers think it's overkill. |
I guess issue here is HTTP doesn't have any kind of "reset response" support in the protocol. HTTP expects that by the time you are sending the first response bytes you know definitively that sending the remainder of the response will not produce any error. But with streaming responses + lazy evaluation that is no longer the case... |
Per docs on Exception response handler, Warp handles application exceptions and returns an HTTP 500 response. This often doesn't actually work due to lazy evaluation of the response body.
Instead, connection is immediately terminated with no response to client.
What are the consequences of forcing strict evaluation of the body/status/headers here? These are all soon to be evaluated for return to client regardless.
ghc-9.6.4.exe
warp-3.3.31
The text was updated successfully, but these errors were encountered: