Defined in: sdk-js/src/v4/internal/errors.ts:9
Thrown when the server returns a 4xx/5xx response. The aggregator
speaks RFC 7807 problem+json (application/problem+json); this
class surfaces every field plus the underlying HTTP status so SDK
callers can pattern-match without re-parsing the body.
Errornew APIError(status: number, init: object): APIError;
Defined in: sdk-js/src/v4/internal/errors.ts:21
| Parameter | Type | Description |
|---|---|---|
status | number | - |
init | { code?: string; title?: string; detail?: string; requestId?: string; problem?: { type: string; title: string; status: number; detail?: string; instance?: string; code?: string; }; } | - |
init.code? | string | - |
init.title? | string | - |
init.detail? | string | - |
init.requestId? | string | - |
init.problem? | { type: string; title: string; status: number; detail?: string; instance?: string; code?: string; } | - |
init.problem.type | string | Format: uri Description URI identifying the problem type. Example https://docs.avaprotocol.org/errors/workflow-not-found |
init.problem.title | string | Description Short, human-readable summary. Example Workflow not found |
init.problem.status | number | Format: int32 Description HTTP status code (echoed for clients that surface only the body). Example 404 |
init.problem.detail? | string | Description Human-readable explanation specific to this occurrence. Example No workflow with id 01JG2FE5MDVKBPHEG0PEYSDKAC for owner 0xabc... |
init.problem.instance? | string | Description URI / opaque ID identifying this specific occurrence (e.g., request id). Example req_01JG2FE5MFKTH0754RGF2DMVY7 |
init.problem.code? | string | Description Machine-readable error code. Stable across releases; clients can switch on this for programmatic handling. Mirrors the gRPC-era ErrorCode enum vocabulary. Example WORKFLOW_NOT_FOUND |
APIError
Error.constructor
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
status | readonly | number | HTTP status code (echoed from the response). | sdk-js/src/v4/internal/errors.ts:11 |
code? | readonly | string | Machine-readable error code (Problem.code), e.g. AUTH_INVALID_TOKEN. | sdk-js/src/v4/internal/errors.ts:13 |
title? | readonly | string | Short human-readable summary (Problem.title). | sdk-js/src/v4/internal/errors.ts:15 |
requestId? | readonly | string | Per-request identifier — also surfaced via X-Request-ID header. | sdk-js/src/v4/internal/errors.ts:17 |
problem? | readonly | object | The full parsed Problem body, when the server returned one. | sdk-js/src/v4/internal/errors.ts:19 |
problem.type | readonly | string | Format: uri Description URI identifying the problem type. Example https://docs.avaprotocol.org/errors/workflow-not-found | types/dist/openapi.gen.d.ts:660 |
problem.title | readonly | string | Description Short, human-readable summary. Example Workflow not found | types/dist/openapi.gen.d.ts:665 |
problem.status | readonly | number | Format: int32 Description HTTP status code (echoed for clients that surface only the body). Example 404 | types/dist/openapi.gen.d.ts:671 |
problem.detail? | readonly | string | Description Human-readable explanation specific to this occurrence. Example No workflow with id 01JG2FE5MDVKBPHEG0PEYSDKAC for owner 0xabc... | types/dist/openapi.gen.d.ts:676 |
problem.instance? | readonly | string | Description URI / opaque ID identifying this specific occurrence (e.g., request id). Example req_01JG2FE5MFKTH0754RGF2DMVY7 | types/dist/openapi.gen.d.ts:681 |
problem.code? | readonly | string | Description Machine-readable error code. Stable across releases; clients can switch on this for programmatic handling. Mirrors the gRPC-era ErrorCode enum vocabulary. Example WORKFLOW_NOT_FOUND | types/dist/openapi.gen.d.ts:688 |