This module contains error-related types and logic.

#HTTPError Source

type HTTPError = { details :: Maybe String, overview :: String, priority :: Int, statusCode :: Int }

The type of an HTTP error, part of the handler type ExceptT HTTPError m a

#error300 Source

error300 :: HTTPError

A Multiple Choices error

#error301 Source

error301 :: HTTPError

A Moved Permanently error

#error302 Source

error302 :: HTTPError

A Found error

#error303 Source

error303 :: HTTPError

A See Other error

#error304 Source

error304 :: HTTPError

A Not Modified error

#error305 Source

error305 :: HTTPError

A Use Proxy error

#error307 Source

error307 :: HTTPError

A Temporary Redirect error

#error400 Source

error400 :: HTTPError

A Bad Request error

#error401 Source

error401 :: HTTPError

A Unauthorized error

#error402 Source

error402 :: HTTPError

A Payment Required error

#error403 Source

error403 :: HTTPError

A Forbidden error

#error404 Source

error404 :: HTTPError

A Not Found error

#error405 Source

error405 :: HTTPError

A Method Not Allowed error

#error406 Source

error406 :: HTTPError

A Not Acceptable error

#error407 Source

error407 :: HTTPError

A Proxy Authentication Required error

#error409 Source

error409 :: HTTPError

A Conflict error

#error410 Source

error410 :: HTTPError

A Gone error

#error411 Source

error411 :: HTTPError

A Length Required error

#error412 Source

error412 :: HTTPError

A Precondition Failed error

#error413 Source

error413 :: HTTPError

A Request Entity Too Large error

#error414 Source

error414 :: HTTPError

A Request-URI Too Large error

#error415 Source

error415 :: HTTPError

A Unsupported Media Type error

#error416 Source

error416 :: HTTPError

A Request range not satisfiable error

#error417 Source

error417 :: HTTPError

A Expectation Failed error

#error418 Source

error418 :: HTTPError

A I'm a teapot error

#error422 Source

error422 :: HTTPError

A Unprocessable Entity error

#error500 Source

error500 :: HTTPError

A Internal Server Error error

#error501 Source

error501 :: HTTPError

A Not Implemented error

#error502 Source

error502 :: HTTPError

A Bad Gateway error

#error503 Source

error503 :: HTTPError

A Service Unavailable error

#error504 Source

error504 :: HTTPError

A Gateway Time-out error

#error505 Source

error505 :: HTTPError

A HTTP Version not supported error

#select Source

select :: HTTPError -> HTTPError -> HTTPError

Given two HTTPError values, determines the best response based on priority or, when equal by priority, status code. The router assigns a lower priority based on route specificity/depth so that the error presented to the client is the one that is easier to resolve.