Error returned (or raised by the bang functions) for anything other than a 200 or 404 answer.
| reason | HTTP | meaning |
|---|---|---|
:invalid_id | 400 | id missing, too long, or not a recognised identifier |
:unauthorized | 401 | missing or invalid API key |
:quota_exceeded | 403 | monthly lookups used; see monthly_lookups/1 |
:server_error | 5xx | temporary, safe to retry |
:transport | none | network failure, timeout or a body that is not JSON |
:unexpected | other | any other status |
Summary
Functions
The monthly_lookups value from a 403 body, or nil.
True for errors worth retrying later (5xx and transport).
Types
@type reason() ::
:invalid_id
| :unauthorized
| :quota_exceeded
| :server_error
| :transport
| :unexpected
@type t() :: %AppBlockList.Error{ __exception__: true, body: map(), message: String.t(), reason: reason(), status: non_neg_integer() | nil }