Structured error returned by every failing call as {:error, %Noizu.WhatsApp.Error{}}.
Returned, never raised in the normal flow (it is a defexception so
pagination streams can raise it mid-enumeration).
:tag | :reason | When |
|---|---|---|
:api | Graph error code (integer, e.g. 131047) | non-2xx with the Graph error envelope |
:rate_limited | :rate_limited | 429 still returned after the bounded retry gave up |
:http | :http_error | non-2xx without a Graph envelope |
:transport | the transport exception | connection refused, timeout, … |
:config | an atom (:missing_token, …) | missing token / phone number id / WABA id |
:validation | an atom (e.g. :invalid_phone) | client-side validation |
:kind— semantic error class. Graph code131047(re-engagement message sent outside the 24h customer-service window) maps to:window_closed; usesend_template/4to restart the window.:subcode— the Grapherror_subcodewhen present.:body— the decoded Graph error object.:summary— the Graphmessagestring. Message text never contains a full phone number (Noizu.WhatsApp.Phone.mask/1) or the access token.
Summary
Functions
Missing configuration. subject is masked via Phone.mask/1 when numeric.
Builds an error from an HTTP status and decoded response body.
Graph error code -> semantic kind.
Wraps a transport-level failure.
Client-side validation failure. Phone-like values are masked.
Types
@type kind() :: :window_closed | nil
@type t() :: %Noizu.WhatsApp.Error{ __exception__: term(), body: term(), code: integer() | nil, kind: kind(), message: String.t(), reason: term(), status: pos_integer() | nil, subcode: integer() | nil, summary: String.t() | nil, tag: :api | :rate_limited | :http | :transport | :config | :validation | nil }
Functions
Missing configuration. subject is masked via Phone.mask/1 when numeric.
@spec from_response(pos_integer(), term()) :: t()
Builds an error from an HTTP status and decoded response body.
Graph error code -> semantic kind.
Wraps a transport-level failure.
Client-side validation failure. Phone-like values are masked.