Creates a REST error carrying the upstream HTTP status and body.
The HTTP status returned by the upstream REST API.
The response body returned by the upstream REST API.
OptionalrawAxiosError: unknown
The original Axios error when raw diagnostics are enabled.
Optionaloptions: { contentType?: string; rateLimit?: RateLimitInfo; requestId?: string }
Additional error metadata such as rate-limit headers, the response content type, and the request correlation ID.
Stable code used to classify the failure.
Optional ReadonlycontentThe Content-Type of the failing response, parsed from the upstream
response headers. REST providers such as MyAnimeList return HTML or
plain-text bodies on rate-limit and gateway error paths; this field lets
consumers distinguish a structured JSON failure payload (where
data.message is meaningful) from a non-JSON one without guessing.
Absent when the response carried no Content-Type header.
ReadonlydataResponse body returned by the upstream API, preserved verbatim.
Optional ReadonlyrateRate-limit accounting parsed from the x-ratelimit-limit,
x-ratelimit-remaining, and x-ratelimit-reset response headers,
whenever AniList includes all three. Use it to self-throttle before
the next request instead of waiting for another 429. It is never
included in the error message so logs stay clean.
Optional ReadonlyrawOriginal Axios or transport error when raw diagnostics were enabled.
Optional ReadonlyrequestLibrary-generated correlation ID joining this failure to the
onRequestStart/onResponse/onRetry/onError hook events it
produced, so a caught error can be matched to its lifecycle stream in a
metrics or logging backend. Absent on errors raised outside the
request pipeline (for example validation errors thrown before any
request is sent).
ReadonlystatusHTTP status returned by the upstream API. For GraphQL failures this is the upstream GraphQL error status when available, and the HTTP envelope status (200) otherwise.
A REST-level failure returned by a REST-style provider.
REST APIs report failures as plain HTTP status codes with a JSON (or HTML) body rather than inside a GraphQL envelope, so this subclass exists to give consumers a stable type to branch on without inspecting status codes. It carries no additional fields beyond AniLinkApiError; its value is the named type itself plus the distinct AniLinkErrorCodes.REST code, so consumers can classify REST-provider failures by
codealone, without aninstanceofcheck.See