The error returned or raised by every Demografix call.
A single struct carries the typed :kind, the HTTP :status, the server
:message, and the :quota parsed from the rate-limit headers when present.
Kinds
:kind | Status | Meaning |
|---|---|---|
:auth | 401 | Invalid API key. |
:subscription | 402 | Freebie expired or subscription is not active. |
:validation | 422 | Invalid parameters; also raised client-side for >10 names. |
:rate_limit | 429 | Request limit reached. :quota is always populated. |
:transport | nil | Network failure, timeout, or a non-JSON body. |
:demografix | other | Any other non-2xx response. |
Match on :kind to branch on the error type.
Summary
Types
@type kind() ::
:auth | :subscription | :validation | :rate_limit | :transport | :demografix
@type t() :: %Demografix.Error{ __exception__: true, kind: kind(), message: String.t(), quota: Demografix.Quota.t() | nil, status: integer() | nil }