wai-middleware-json-errors-0.1.2: Converts errors from plaintext to json

Safe HaskellNone
LanguageHaskell2010

Network.Wai.Middleware.JsonErrors

Synopsis

Documentation

jsonErrors :: Application -> Application Source #

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" > }