Skip to content

WriteOperationError

A local write refusal. operationIndex is the refused operation’s position in the submission (or the builder); it is undefined when the refusal is about the whole batch, such as a builder that was already submitted.

code is VALIDATION_ERROR unless the refusal names another: NOT_FOUND (a keepShapes target that does not exist), RESERVED_NAME, ILLEGAL_OP_SEQUENCE, or a Shape-name preflight code.

new WriteOperationError(operationIndex, message, code?): WriteOperationError

number | undefined

string

string = 'VALIDATION_ERROR'

WriteOperationError

WarmHubError.constructor

readonly code: string

Stable SDK error code or pass-through backend domain code. Branch on this (or the alias kind) to handle expected failure modes.

WarmHubError.code


readonly optional status?: number

HTTP status from the failing response when one was available.

WarmHubError.status


readonly optional hint?: string

Optional human-readable hint surfaced by the backend.

WarmHubError.hint


readonly optional retryAfter?: number

Seconds the caller should wait before retrying. Present on RATE_LIMITED responses and other backend signals that carry a Retry-After header.

WarmHubError.retryAfter


readonly optional errorCode?: string

Canonical domain error code from the response body. Set iff the backend wire carried a structured error.code string. Use this when the question is “did the backend specifically say this?”. For best-effort labelling that also covers SDK-local transport codes (NETWORK, CANCELLED, the generic BACKEND fallback), branch on code or kind.

WarmHubError.errorCode


readonly optional backendCode?: string

WarmHubError.backendCode


readonly optional details?: WarmHubErrorDetails

Structured backend error details, when the response carried them. Branch on details.reason: an expected_version_mismatch carries expectedVersion/currentVersion so an optimistic-concurrency caller can re-read HEAD and retry (#3624); a lease_held carries leaseExpiresAt so a caller can back off until the lease expires (#3625). Present only when the backend wire carried data.warmhub.details. See WarmHubErrorDetails.

WarmHubError.details


readonly optional decorationFailure?: true

Present (true) when this error came from the response-decoration label lookup rather than the read itself — the read may have succeeded. Set by the decoration link (see WarmHubClientOptions.decorateResponses); surfaces use it to suggest retrying without decoration. declare: assigned by the link, never by this constructor.

WarmHubError.decorationFailure


readonly operationIndex: number | undefined

get kind(): ErrorKind

ErrorKind

WarmHubError.kind