Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- data JSONResponse = JSONResponse {}
- waiErrorToJSONResponse :: Error -> JSONResponse
- jsonResponseToWai :: JSONResponse -> Response
Documentation
data JSONResponse Source #
A custom JSON response to be returned to the client as an error.
Both static and dynamic errors are converted to this type before being
turned into HTTP responses. It is a generalisation of Error
,
encompassing both standard error values (including label
, code
and
message
fields), and custom error-like responses that include extra data
for the clients.