-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Converts errors from plaintext to json -- -- Converts errors from plaintext to json @package wai-middleware-json-errors @version 0.1.2 module Network.Wai.Middleware.JsonErrors -- | Converts errors from plaintext to json. -- -- Example: a plaintext json parsing error returns a 400 status code and -- a message: > Error in $: key "firstName" not present -- -- Using this middleware it would look like this: > { > "status": -- 400, > "error": "Error in $: key "firstName" not present" > } jsonErrors :: Application -> Application responseModifier :: Response -> Response jsonErrorResponse :: Status -> ResponseHeaders -> ByteString -> Response responseBody :: Response -> Maybe ByteString isPlainTextError :: Status -> ResponseHeaders -> Bool errorInfo :: Response -> Maybe (Status, ResponseHeaders, ByteString) isContentType :: ByteString -> ResponseHeaders -> Bool