om-http-logging-0.1.0.0: om-http-logging

Safe HaskellNone
LanguageHaskell2010

OM.HTTP.Logging

Description

 
Synopsis

Documentation

logExceptionsAndContinue Source #

Arguments

:: (Loc -> LogSource -> LogLevel -> LogStr -> IO ())

Logging backend.

-> Middleware 

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.