NAME

HTTP::API::Core::Error - Structured errors from HTTP::API::Core

DESCRIPTION

HTTP::API::Core throws structured error objects. The category value is the primary machine-readable classification. Human-readable message wording is diagnostic and should not be parsed for program logic.

The stable categories are encode, decode, transport, http, and hook.

METHODS

message, category, status, method, url

Basic structured error metadata.

retryable, retry_after

Retry-related metadata.

elapsed, request_id

Observability metadata when available.

response

Returns the associated HTTP::API::Core::Response for HTTP/decode errors, or undef when no response exists.

body, text

Return associated raw response content, or undef when there is no response.

headers

Returns a defensive copy of response headers. Without a response, returns an empty hash reference.

header($name)

Returns one response header, or undef when no response exists.

json

Explicitly decodes the associated response body as JSON using the response object's json semantics. Without a response, returns undef.

rate_limit

Returns normalized rate-limit metadata when an associated response exists.

as_string

Returns the human-readable diagnostic message. Exact message wording is not part of the machine-readable compatibility contract.