The API's codes: each response code with its status and fixed detail, and every code an error entry may carry. Both lists are the API's contract. Adding a code is compatible. Renaming or removing one, or moving it to another status, is a breaking change.
Summary
Functions
The codes the walker maps from Ecto's own options, and those Lightning sets
with code:.
The code a raise is answered with. Every exception a client can cause has a
4xx status (Plug.Exception.status/1) and is answered by it. Anything else
is :internal: a 500 means Lightning raised where it should not have.
The code a usage or rate limiter's refusal is answered with. The limiter's text is copy for the app's pages, so it never reaches the answer.
Every status code may answer with, its own first.
Types
@type code() ::
:id_taken
| :insufficient_scope
| :being_edited
| :scheduled_for_deletion
| :invalid_request
| :bad_request
| :in_use
| :concurrent_edit
| :invalid_token
| :not_implemented
| :too_many_requests
| :malformed
| :content_too_large
| :not_found
| :not_acceptable
| :service_unavailable
| :invalid_header
| :uri_too_long
| :export_conflict
| :exceeds_limit
| :not_ready
| :timeout
| :forbidden
| :invalid
| :trigger_disabled
| :internal
| :unauthenticated
| :request_timeout
| :bad_gateway
| :invalid_parameter
| :too_many_runs
| :ambiguous_name
| :unsupported_media_type
A response code, one of the keys of the response list.
Functions
@spec entry_codes() :: [atom()]
The codes the walker maps from Ecto's own options, and those Lightning sets
with code:.
The code a raise is answered with. Every exception a client can cause has a
4xx status (Plug.Exception.status/1) and is answered by it. Anything else
is :internal: a 500 means Lightning raised where it should not have.
The code a usage or rate limiter's refusal is answered with. The limiter's text is copy for the app's pages, so it never reaches the answer.
@spec response_codes() :: [code()]
@spec status(code()) :: pos_integer()
@spec statuses(code()) :: [pos_integer()]
Every status code may answer with, its own first.