The API error envelope, mirroring the other Zazu SDKs' hierarchy:
{"error" => {"type" => ..., "message" => ..., "param" => ...}}.
Match on :kind instead of subclassing:
:authentication— 401:forbidden— 403:not_found— 404:validation— 422:rate_limit— 429 (:retry_aftercarries theRetry-Afterseconds):server— 5xx:api— any other non-2xx
Summary
Types
@type kind() ::
:authentication
| :forbidden
| :not_found
| :validation
| :rate_limit
| :server
| :api
@type t() :: %Zazu.Error{ __exception__: true, body: map(), kind: kind(), message: String.t(), param: String.t() | nil, request_id: String.t() | nil, retry_after: non_neg_integer() | nil, status: pos_integer(), type: String.t() | nil }