Skeg. Error exception
(skeg v1.0.0)
Copy Markdown
An error from the server or from the client.
What an error proves about the request decides what the caller may do
next. kind says it:
:connect_failed,:invalid_argument,:not_sent- no byte of the request reached the server, so nothing was applied.nothing_applied?/1is true only for these.:server- the server answered with an error. It may have applied part of the request before failing.codeis the first word of the reply ("ERR","WRONGPASS","BACKPRESSURE"...),messagethe rest. Inside a batch reply an error is one element among the results.:outcome_unknown- no complete answer arrived. The request may have been applied in full, in part, or not at all. The connection is closed.:unexpected_reply- the server answered with a reply of a shape the call does not expect;reasonholds it.
Send a write again only when nothing_applied?/1 is true, or after reading
back what the server holds. Commands are never retried automatically.
reason details the client-side kinds:
:not_sent-:closed,:deadline_exceeded(the deadline passed while the request waited behind others),:unsolicited_data(the server sent bytes nobody asked for, so the connection was closed), or{:reconnect, error}:outcome_unknown-:timeout,:peer_closed,{:transport, posix},{:protocol, decode_reason},:trailing_data(more replies than requests),:reply_too_large, or{:owner_exit, reason}:connect_failed- the:gen_tcpreason:invalid_argument- a description of the limit exceeded
Summary
Functions
Whether the error proves that the server applied nothing: the connection was never opened, or the request was refused or dropped before sending.
Whether the server described its refusal as temporary (BACKPRESSURE, or
RATELIMITED from a tenant backend), so the same request may succeed
later. This says nothing about effects already applied: combine it with
nothing_applied?/1, or with a request that is safe to repeat.
Types
Functions
Whether the error proves that the server applied nothing: the connection was never opened, or the request was refused or dropped before sending.
Whether the server described its refusal as temporary (BACKPRESSURE, or
RATELIMITED from a tenant backend), so the same request may succeed
later. This says nothing about effects already applied: combine it with
nothing_applied?/1, or with a request that is safe to repeat.