Normalized error returned by ReqAnthropic when the Anthropic API responds with a non-2xx status, or when the client itself fails before sending.
Summary
Functions
Build an Error from a Req response. The Anthropic API returns errors as
%{"type" => "error", "error" => %{"type" => ..., "message" => ...}}.
Build an Error from a Req response with a pre-parsed %RateLimit{}.
Types
@type t() :: %ReqAnthropic.Error{ __exception__: term(), message: String.t() | nil, rate_limit: ReqAnthropic.RateLimit.t() | nil, raw: term(), request_id: String.t() | nil, status: pos_integer() | nil, type: String.t() | nil }
Functions
@spec from_response(Req.Response.t()) :: t()
Build an Error from a Req response. The Anthropic API returns errors as
%{"type" => "error", "error" => %{"type" => ..., "message" => ...}}.
@spec from_response(Req.Response.t(), ReqAnthropic.RateLimit.t()) :: t()
Build an Error from a Req response with a pre-parsed %RateLimit{}.