I am developing a Warp / WarpTLS application and a bunch of middleware (without yesod), all of which handles its own exceptions.
Currently I want to deal with Exceptions raised within Warp and WarpTLS and I am unclear about what exceptions can occur and if a handler provided to setOnException is sufficient to handle all exceptions (including TLS exceptions for instance).
Here is what I understand:
- setOnException can be used to catch warp-internal exceptions (as well as application exceptions) according to the doc
- Warp exposes InvalidRequest with an Exceptioninstance.
- Inspecting the src of defaultOnExceptionResponse suggests that ConnectionErrormay be raised from within Warp.
My questions:
- If I provide a handler to setOnExceptioncan I be sure all internal exceptions will end up there?
- Does 1) hold true even if I use WarpTLS and runTLS?
- What kind of exceptions may be thrown by runSettings(Warp) andrunTLS(WarpTLS)?