Skip to main content
Every error thrown by the SDK is a subclass of SpineError, so a single catch (err instanceof SpineError) clause catches anything the SDK can throw.

Error hierarchy

Inspecting errors

SpineAPIError carries the HTTP status, the server’s error message, the request id (useful when reporting issues), and the raw body:
See Errors for the full list of server-side error messages.

Client-side short-circuit

Some validation runs locally without a network round-trip so you get the same typed error regardless of where the check fired:

Automatic retries

The SDK retries transient failures automatically with jittered exponential backoff: When the retry budget is exhausted, the underlying error (SpineServerError or SpineConnectionError) is thrown.

Tuning retries

Timeouts

The HTTP timeout is 60 seconds per request by default. Override it with timeoutMs:
The polling timeout (waitForCompletion) is independent and defaults to 15 minutes. Tune it per call:
SpineTimeoutError is thrown when either timeout fires.

SpineRunFailedError

Thrown by waitForCompletion when the run terminates with status: 'failed'. Carries runId and an errors: { error: string }[] list. If you would rather handle the failed run as a value:
A 'partial' status is not a failure — the run produced usable output with some blocks skipped. Inspect terminal.errors on the returned object.