Skip to Content

ApiClientError

A normalized SDK failure that does not expose transport or server implementation details.

Extends

  • Error

Constructors

Constructor

new ApiClientError(__namedParameters): ApiClientError;

Parameters

__namedParameters
cause?

unknown

What the SDK saw, for a debugger; never shown to a user.

code

| "INVALID_REQUEST" | "UNAUTHENTICATED" | "PAYMENT_REQUIRED" | "FORBIDDEN" | "NOT_FOUND" | "CONFLICT" | "PAYLOAD_TOO_LARGE" | "RATE_LIMITED" | "USAGE_LIMIT_EXHAUSTED" | "SERVICE_UNAVAILABLE" | "INTERNAL_ERROR"

message

string

param?

string | null = null

reason?

| ReceivedApiErrorReason | null = null

requestId?

string | null = null

requiredPermission?

ReceivedResourceKindPermission | null = null

retryAfterSeconds?

number | null = null

status?

number | null = null

Overrides

Error.constructor

Properties

[API_CLIENT_ERROR]

readonly [API_CLIENT_ERROR]: true = true;

code

readonly code: | "INVALID_REQUEST" | "UNAUTHENTICATED" | "PAYMENT_REQUIRED" | "FORBIDDEN" | "NOT_FOUND" | "CONFLICT" | "PAYLOAD_TOO_LARGE" | "RATE_LIMITED" | "USAGE_LIMIT_EXHAUSTED" | "SERVICE_UNAVAILABLE" | "INTERNAL_ERROR";

param

readonly param: string | null;

The request field a 400 rejected.


reason

readonly reason: | ReceivedApiErrorReason | null;

requestId

readonly requestId: string | null;

requiredPermission

readonly requiredPermission: ReceivedResourceKindPermission | null;

The permission an admin API key lacks, with a 403.


retryAfterSeconds

readonly retryAfterSeconds: number | null;

status

readonly status: number | null;

Methods

Last updated on