Skip to content
providerkit
GitHub

TranscriptionError

Defined in: core/src/transcription-core.ts:111

A reply that arrived but holds no usable transcript, or a failure the provider reported inside a 200. Carries the usage the provider stated for it, because it billed that: a caller that drops this loses the only record of the charge. Plain ProviderErrors carry no usage.

new TranscriptionError(
provider,
kind,
message,
opts?
): TranscriptionError;

Defined in: core/src/transcription-core.ts:114

Parameter Type
provider string
kind ErrorKind
message string
opts object & object

TranscriptionError

ProviderError.constructor

readonly optional body?: string;

Defined in: core/src/errors.ts:127

The provider’s own response body, truncated. It carries the actual reason, otherwise lost behind “400 status code (no body)”.

ProviderError.body


optional cause?: unknown;

Defined in: node_modules/.bun/[email protected]/node_modules/typescript/lib/lib.es2022.error.d.ts:26

ProviderError.cause


readonly optional code?: string;

Defined in: core/src/errors.ts:116

ProviderError.code


readonly kind: ErrorKind;

Defined in: core/src/errors.ts:114

ProviderError.kind


message: string;

Defined in: node_modules/.bun/[email protected]/node_modules/typescript/lib/lib.es5.d.ts:1077

ProviderError.message


name: string;

Defined in: node_modules/.bun/[email protected]/node_modules/typescript/lib/lib.es5.d.ts:1076

ProviderError.name


readonly provider: string;

Defined in: core/src/errors.ts:113

ProviderError.provider


readonly optional resetAtMs?: number;

Defined in: core/src/errors.ts:121

Absolute reset of the binding limit. Can be days beyond Retry-After.

ProviderError.resetAtMs


readonly optional retryAfterMs?: number;

Defined in: core/src/errors.ts:119

Honoured when the provider said how long to wait (Retry-After, or Gemini’s RetryInfo.retryDelay).

ProviderError.retryAfterMs


readonly optional shouldRetry?: boolean;

Defined in: core/src/errors.ts:124

Explicit server directive (x-should-retry), overriding default classification.

ProviderError.shouldRetry


optional stack?: string;

Defined in: node_modules/.bun/[email protected]/node_modules/typescript/lib/lib.es5.d.ts:1078

ProviderError.stack


readonly optional status?: number;

Defined in: core/src/errors.ts:115

ProviderError.status


readonly optional usage?: TranscriptionUsage;

Defined in: core/src/transcription-core.ts:112


readonly optional window?: RateLimitWindow;

Defined in: core/src/errors.ts:122

ProviderError.window

get isBackupEligible(): boolean;

Defined in: core/src/errors.ts:162

boolean

ProviderError.isBackupEligible


get isTransient(): boolean;

Defined in: core/src/errors.ts:157

boolean

ProviderError.isTransient

static from(provider, err): ProviderError;

Defined in: core/src/errors.ts:168

Wrap anything thrown into a classified ProviderError. Already-wrapped errors pass through untouched, so classification happens exactly once.

Parameter Type
provider string
err unknown

ProviderError

ProviderError.from