Boom (Boom v0.1.0) View Source

Boom is inspired by the NodeJS package @hapi/boom

It allows you to respond with json errors easily.

Link to this section Summary

Functions

Responds with 502 - Bad Gateway

Responds with 400 - Bad Request

Responds with 509 - Bandwidth Limit Exceeded

Responds with 409 - Conflict

Responds with 417 - Expectation Failed

Responds with 424 - Failed Dependency

Responds with 403 - Forbidden

Responds with 504 - Gateway Time-out

Responds with 410 - Gone

Responds with 505 - HTTP Version Not Supported

Responds with 418 - I'm a teapot

Responds with 507 - Insufficient Storage

Responds with 500 - Internal Server Error

Responds with 411 - Length Required

Responds with 423 - Locked

Responds with 508 - Loop Detected

Responds with 405 - Method Not Allowed

Responds with 421 - Misdirected Request

Responds with 511 - Network Authentication Required

Responds with 406 - Not Acceptable

Responds with 510 - Not Extended

Responds with 404 - Not Found

Responds with 501 - Not Implemented

Responds with 402 - Payment Required

Responds with 412 - Precondition Failed

Responds with 428 - Precondition Required

Responds with 407 - Proxy Authentication Required

Responds with 413 - Request Entity Too Large

Responds with 431 - Request Header Fields Too Large

Responds with 408 - Request Time-out

Responds with 414 - Request-URI Too Large

Responds with 416 - Requested Range Not Satisfiable

Responds with 503 - Service Unavailable

Responds with 429 - Too Many Requests

Responds with 401 - Unauthorized

Responds with 451 - Unavailable For Legal Reasons

Responds with 425 - Unordered Collection

Responds with 422 - Unprocessable Entity

Responds with 415 - Unsupported Media Type

Responds with 426 - Upgrade Required

Responds with 506 - Variant Also Negotiates

Link to this section Functions

Link to this function

bad_gateway(conn, message \\ nil)

View Source

Specs

bad_gateway(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 502 - Bad Gateway

Link to this function

bad_request(conn, message \\ nil)

View Source

Specs

bad_request(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 400 - Bad Request

Link to this function

bandwidth_limit_exceeded(conn, message \\ nil)

View Source

Specs

bandwidth_limit_exceeded(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 509 - Bandwidth Limit Exceeded

Link to this function

conflict(conn, message \\ nil)

View Source

Specs

conflict(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 409 - Conflict

Link to this function

expectation_failed(conn, message \\ nil)

View Source

Specs

expectation_failed(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 417 - Expectation Failed

Link to this function

failed_dependency(conn, message \\ nil)

View Source

Specs

failed_dependency(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 424 - Failed Dependency

Link to this function

forbidden(conn, message \\ nil)

View Source

Specs

forbidden(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 403 - Forbidden

Link to this function

gateway_timeout(conn, message \\ nil)

View Source

Specs

gateway_timeout(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 504 - Gateway Time-out

Link to this function

gone(conn, message \\ nil)

View Source

Specs

gone(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 410 - Gone

Link to this function

http_version_not_supported(conn, message \\ nil)

View Source

Specs

http_version_not_supported(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 505 - HTTP Version Not Supported

Link to this function

im_a_teapot(conn, message \\ nil)

View Source

Specs

im_a_teapot(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 418 - I'm a teapot

Link to this function

insufficient_storage(conn, message \\ nil)

View Source

Specs

insufficient_storage(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 507 - Insufficient Storage

Link to this function

internal_server_error(conn, message \\ nil)

View Source

Specs

internal_server_error(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 500 - Internal Server Error

Link to this function

length_required(conn, message \\ nil)

View Source

Specs

length_required(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 411 - Length Required

Link to this function

locked(conn, message \\ nil)

View Source

Specs

locked(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 423 - Locked

Link to this function

loop_detected(conn, message \\ nil)

View Source

Specs

loop_detected(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 508 - Loop Detected

Link to this function

method_not_allowed(conn, message \\ nil)

View Source

Specs

method_not_allowed(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 405 - Method Not Allowed

Link to this function

misdirected_request(conn, message \\ nil)

View Source

Specs

misdirected_request(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 421 - Misdirected Request

Link to this function

network_authentication_required(conn, message \\ nil)

View Source

Specs

network_authentication_required(Plug.Conn.t(), String.t() | nil) ::
  Plug.Conn.t()

Responds with 511 - Network Authentication Required

Link to this function

not_acceptable(conn, message \\ nil)

View Source

Specs

not_acceptable(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 406 - Not Acceptable

Link to this function

not_extended(conn, message \\ nil)

View Source

Specs

not_extended(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 510 - Not Extended

Link to this function

not_found(conn, message \\ nil)

View Source

Specs

not_found(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 404 - Not Found

Link to this function

not_implemented(conn, message \\ nil)

View Source

Specs

not_implemented(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 501 - Not Implemented

Link to this function

payment_required(conn, message \\ nil)

View Source

Specs

payment_required(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 402 - Payment Required

Link to this function

precondition_failed(conn, message \\ nil)

View Source

Specs

precondition_failed(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 412 - Precondition Failed

Link to this function

precondition_required(conn, message \\ nil)

View Source

Specs

precondition_required(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 428 - Precondition Required

Link to this function

proxy_authentication_required(conn, message \\ nil)

View Source

Specs

proxy_authentication_required(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 407 - Proxy Authentication Required

Link to this function

request_entity_too_large(conn, message \\ nil)

View Source

Specs

request_entity_too_large(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 413 - Request Entity Too Large

Link to this function

request_header_fields_too_large(conn, message \\ nil)

View Source

Specs

request_header_fields_too_large(Plug.Conn.t(), String.t() | nil) ::
  Plug.Conn.t()

Responds with 431 - Request Header Fields Too Large

Link to this function

request_timeout(conn, message \\ nil)

View Source

Specs

request_timeout(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 408 - Request Time-out

Link to this function

request_uri_too_long(conn, message \\ nil)

View Source

Specs

request_uri_too_long(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 414 - Request-URI Too Large

Link to this function

requested_range_not_satisfiable(conn, message \\ nil)

View Source

Specs

requested_range_not_satisfiable(Plug.Conn.t(), String.t() | nil) ::
  Plug.Conn.t()

Responds with 416 - Requested Range Not Satisfiable

Link to this function

service_unavailable(conn, message \\ nil)

View Source

Specs

service_unavailable(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 503 - Service Unavailable

Link to this function

too_many_requests(conn, message \\ nil)

View Source

Specs

too_many_requests(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 429 - Too Many Requests

Link to this function

unauthorized(conn, message \\ nil)

View Source

Specs

unauthorized(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 401 - Unauthorized

Link to this function

unordered_collection(conn, message \\ nil)

View Source

Specs

unordered_collection(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 425 - Unordered Collection

Link to this function

unprocessable_entity(conn, message \\ nil)

View Source

Specs

unprocessable_entity(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 422 - Unprocessable Entity

Link to this function

unsupported_media_type(conn, message \\ nil)

View Source

Specs

unsupported_media_type(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 415 - Unsupported Media Type

Link to this function

upgrade_required(conn, message \\ nil)

View Source

Specs

upgrade_required(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 426 - Upgrade Required

Link to this function

variant_also_negotiates(conn, message \\ nil)

View Source

Specs

variant_also_negotiates(Plug.Conn.t(), String.t() | nil) :: Plug.Conn.t()

Responds with 506 - Variant Also Negotiates