Normalized error returned by Polymarket CLOB API helpers.
Every PolymarketClob.API.* and PolymarketClob.HTTP.* call returns either
{:ok, body} or {:error, %PolymarketClob.Error{}}. Match on :reason
to distinguish failure modes without parsing the message string:
:http_error— CLOB returned a non-2xx status.:statusand:bodyare populated;:messageis the upstream error message when present.:transport_error— Req-level transport failure (DNS, TCP, TLS, timeout).:bodycarries the underlying exception/reason.:decode_error— response body was not valid JSON when JSON was expected.:auth_error— request would have been authenticated but thePolymarketClob.Clientlacks complete L2 credentials (api_key,api_secret,api_passphrase). Raised before any HTTP call is made.
:request_path is populated whenever it is known (which is for every error
produced by PolymarketClob.HTTP), and is the path that was attempted —
including any query string the caller sent.
Summary
Types
@type reason() :: :http_error | :transport_error | :decode_error | :auth_error
@type t() :: %PolymarketClob.Error{ body: term(), message: String.t(), reason: reason(), request_path: String.t() | nil, status: non_neg_integer() | nil }