Returned as {:error, %KapsoEx.Error{}} when a request fails.
Fields
:status- HTTP status code, ornilfor transport errors.:message- human readable message extracted from the response body.:code- error code from the body when present. Meta-style errors from the WhatsApp API carry an integer code (for example131047), Platform errors may carry a string code (for example"findings_not_enabled").:body- the decoded response body.:headers- response headers, a map of lowercase name to list of values.:retry_after- seconds from theRetry-Afterheader, when present. Set on429responses.:reason- the underlying exception for transport errors (timeouts, connection refused, ...).
Summary
Types
@type t() :: %KapsoEx.Error{ __exception__: true, body: term(), code: integer() | String.t() | nil, headers: %{optional(String.t()) => [String.t()]}, message: String.t(), reason: Exception.t() | nil, retry_after: non_neg_integer() | nil, status: non_neg_integer() | nil }