SpeechError
Defined in: core/src/speech-core.ts:96
A reply that arrived but holds no usable audio, 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.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new SpeechError( provider, kind, message, opts?): SpeechError;Defined in: core/src/speech-core.ts:99
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
provider |
string |
kind |
ErrorKind |
message |
string |
opts |
object & object |
Returns
Section titled “Returns”SpeechError
Overrides
Section titled “Overrides”Properties
Section titled “Properties”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)”.
Inherited from
Section titled “Inherited from”cause?
Section titled “cause?”optional cause?: unknown;Defined in: node_modules/.bun/[email protected]/node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
Section titled “Inherited from”readonly optional code?: string;Defined in: core/src/errors.ts:116
Inherited from
Section titled “Inherited from”readonly kind: ErrorKind;Defined in: core/src/errors.ts:114
Inherited from
Section titled “Inherited from”message
Section titled “message”message: string;Defined in: node_modules/.bun/[email protected]/node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
Section titled “Inherited from”name: string;Defined in: node_modules/.bun/[email protected]/node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
Section titled “Inherited from”provider
Section titled “provider”readonly provider: string;Defined in: core/src/errors.ts:113
Inherited from
Section titled “Inherited from”resetAtMs?
Section titled “resetAtMs?”readonly optional resetAtMs?: number;Defined in: core/src/errors.ts:121
Absolute reset of the binding limit. Can be days beyond Retry-After.
Inherited from
Section titled “Inherited from”retryAfterMs?
Section titled “retryAfterMs?”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).
Inherited from
Section titled “Inherited from”shouldRetry?
Section titled “shouldRetry?”readonly optional shouldRetry?: boolean;Defined in: core/src/errors.ts:124
Explicit server directive (x-should-retry), overriding default classification.
Inherited from
Section titled “Inherited from”stack?
Section titled “stack?”optional stack?: string;Defined in: node_modules/.bun/[email protected]/node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
Section titled “Inherited from”status?
Section titled “status?”readonly optional status?: number;Defined in: core/src/errors.ts:115
Inherited from
Section titled “Inherited from”usage?
Section titled “usage?”readonly optional usage?: SpeechUsage;Defined in: core/src/speech-core.ts:97
window?
Section titled “window?”readonly optional window?: RateLimitWindow;Defined in: core/src/errors.ts:122
Inherited from
Section titled “Inherited from”Accessors
Section titled “Accessors”isBackupEligible
Section titled “isBackupEligible”Get Signature
Section titled “Get Signature”get isBackupEligible(): boolean;Defined in: core/src/errors.ts:162
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”ProviderError.isBackupEligible
isTransient
Section titled “isTransient”Get Signature
Section titled “Get Signature”get isTransient(): boolean;Defined in: core/src/errors.ts:157
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”from()
Section titled “from()”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
provider |
string |
err |
unknown |