NorthlightSDK

Errors

The base error every failed request throws, its status-specific subclasses, and the SDK version.

Exports of @north-light/sdk, read from the TypeScript compiler at build time. Types re-exported from @north-light/api are documented with that package.

APIConnectionError

class declared in errors.ts

The daemon could not be reached, or the connection failed mid-request.

Prop

Type

APIConnectionTimeoutError

class declared in errors.ts

The request exceeded its timeout before the daemon answered.

Prop

Type

APIUserAbortError

class declared in errors.ts

The caller's AbortSignal fired.

Prop

Type

AuthenticationError

class declared in errors.ts

The token was missing or wrong: HTTP 401.

Prop

Type

BadRequestError

class declared in errors.ts

The daemon rejected the request: HTTP 400.

Prop

Type

ConflictError

class declared in errors.ts

The resource is in a state that forbids the request: HTTP 409.

Prop

Type

CrouterError

class declared in errors.ts

An SDK configuration or protocol error, raised by the SDK itself. Its code is an SdkErrorCode.

Prop

Type

DeadlineDetails

interface declared in errors.ts

DeadlineExceededError.details.

Prop

Type

DeadlineExceededError

class declared in errors.ts

The call's overall deadline (budgetMs / deadlineAt) passed, or the next retry wait would have passed it. status 504, code deadline_exceeded. deadlineAt is the instant (epoch ms); reason is elapsed (time ran out) or retry_after (the server asked for a wait longer than the time left, so the call stopped without sleeping; retryAfterS is that request). cause is the last failure, when there was one.

Prop

Type

InternalServerError

class declared in errors.ts

The daemon failed while handling the request: HTTP 500 and above.

Prop

Type

mapError

function declared in errors.ts

Maps a transport failure or a plain APIError onto the specific class for its status and code.

(error: unknown) => APIError

NotFoundError

class declared in errors.ts

No such node, profile, cron, or other resource: HTTP 404.

Prop

Type

PermissionDeniedError

class declared in errors.ts

The caller is not allowed to do this: HTTP 403.

Prop

Type

RateLimitError

class declared in errors.ts

Too many requests: HTTP 429.

Prop

Type

RuntimeVersionDetails

interface declared in errors.ts

RuntimeVersionError.details.

Prop

Type

RuntimeVersionError

class declared in errors.ts

The runtime does not serve the contract level this SDK requires (or names no level at all), so the SDK's types do not describe what it sends. Raised before the SDK reads the response; never retryable. Upgrade the runtime (or pin the SDK to the runtime's release). code is runtime_version_unsupported, status 426.

Prop

Type

SDK_VERSION

variable declared in version.ts

This SDK's release version. Informational only: compatibility is the contract level, not this number.

Prop

Type

SdkErrorCode

type declared in error-codes.ts

A code the SDK raises itself. An APIError's code is one of these or an ErrorCode from the contract.

"connection_error" | "crouter_error" | "daemon_health_unavailable" | "daemon_request_interrupted" | "daemon_unavailable" | "deadline_exceeded" | "id_token_invalid" | "invalid_response" | "not_connected" | "oauth_exchange_mismatch" | "oauth_nonce_missing" | "oauth_state_mismatch" | "refusal_handler_reentry" | "request_aborted" | "request_timeout" | "run_idle" | "runtime_version_unsupported" | "stream_ended" | "stream_error" | "transport_error" | "waiting_on_user"

sdkErrorCodes

variable declared in error-codes.ts

Codes the SDK raises itself rather than reading from a daemon or directory response.

Prop

Type

UnprocessableEntityError

class declared in errors.ts

The request was well-formed but unusable, or too large: HTTP 413 and 422.

Prop

Type

On this page