Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- logExceptionsAndContinue :: (Loc -> LogSource -> LogLevel -> LogStr -> IO ()) -> Middleware
Documentation
logExceptionsAndContinue Source #
Logs all exceptions, and returns a 500 Internal Server error.
This is useful because your wai framework won't always do what you
expect when it encounters random exceptions. For instance, an exception
thrown in IO may cause functionality of higher-level middlewares to be
bypassed unless they know how to catch and re-throw exceptions (making
them more complicated). This middleware explicitly will not re-throw
exceptions, unless those exceptions were encountered after the headers
have already been sent, e.g. when using StreamingBody
.
What it will do is generate a unique id for the exception and print that ID, so you can easily find it in the logs.