A management API call that did not succeed (sc-1504).
Every EndPointBlank.Management call answers {:error, %Error{}} rather
than raising; the stream/… functions raise it, since a stream cannot
answer a tuple.
:code-- the API's stableerror.code, a string, for programs to match on ("not_found","validation_failed","plan_limit", ...). A code this SDK does not know yet is kept as sent: seeknown_codes/0. The SDK adds four of its own, for answers that never reached the API or did not come back in its error shape:"transport_error","unexpected_response","invalid_request"and"not_available_for_managed_client".:message-- for people; it may change.:details-- field-level detail when the API sent any (for"validation_failed", the invalid fields), otherwisenil.:status-- the HTTP status, ornilwhen no answer arrived.:retry_after-- theRetry-Afterheader in seconds, when sent.:location-- theLocationheader, when sent. A credential POST refused with"idempotency_replay_unavailable"carries the credential's path here.
The management key is never part of an error, and neither is a request or response body other than the API's own error object.
case EndPointBlank.Management.Clients.get(mgmt, id) do
{:ok, client} -> client
{:error, %Error{code: "not_found"}} -> nil
{:error, %Error{code: "rate_limited", retry_after: seconds}} -> ...
end
Summary
Functions
True when code is one the management API is documented to answer.
The error codes the management API is documented to answer, mapped to their HTTP status. A code missing from this map can still arrive and is surfaced unchanged; never treat an unknown code as a bug.
Types
@type t() :: %EndPointBlank.Management.Error{ __exception__: true, code: String.t(), details: term(), location: String.t() | nil, message: String.t(), retry_after: non_neg_integer() | nil, status: pos_integer() | nil }
Functions
True when code is one the management API is documented to answer.
@spec known_codes() :: %{required(String.t()) => pos_integer()}
The error codes the management API is documented to answer, mapped to their HTTP status. A code missing from this map can still arrive and is surfaced unchanged; never treat an unknown code as a bug.