Structured error returned by every failing call as {:error, %Noizu.Discord.Error{}}.
Returned, never raised in the normal flow (it is a defexception so pagination
streams can raise it mid-enumeration).
:tag | :reason | When |
|---|---|---|
:api | Discord JSON error code (integer, e.g. 10003) | non-2xx with the {code, message, errors} envelope |
:rate_limited | :rate_limited | 429 still returned after the bounded retry gave up |
:http | :http_error | non-2xx without a Discord envelope |
:transport | the transport exception | connection refused, timeout, … |
:config | :missing_token | no bot token configured |
:validation | an atom (e.g. :embed_too_long) | client-side validation (embeds, webhook URL, …) |
:status— HTTP status when a response arrived.:body— decoded JSON (or raw body); for:apierrors this holds the nested"errors"object describing field-level failures.:summary— Discord'smessagestring when present.
Summary
Functions
Missing configuration (e.g. no bot token).
Builds an error from an HTTP status and decoded response body.
Wraps a transport-level failure.
Client-side validation failure.
Types
Functions
Missing configuration (e.g. no bot token).
@spec from_response(pos_integer(), term()) :: t()
Builds an error from an HTTP status and decoded response body.
Wraps a transport-level failure.
Client-side validation failure.