Retry-After duration parsed from the last 429 response (milliseconds).
The request hit the rate limit and exhausted all retries.
HTTP status code (always 401).
Authentication failed (401 response that could not be refreshed).
The underlying error thrown by fetch.
A network-level error occurred (fetch threw).
Parsed response body (object if JSON, string otherwise).
HTTP status code.
The API returned a non-2xx status code other than 401/429.
Raw response body that failed to parse.
Optionalcause?: unknownThe underlying error thrown during parsing, if any (e.g. a SyntaxError from JSON.parse).
Description of what failed to parse.
Structured data embedded in a non-JSON response could not be extracted or parsed.
Discriminated union of all errors that can occur when using the pixiv API client.
Use the
typefield to discriminate: