ProviderError
Defined in: core/src/errors.ts:117
Extends
Section titled “Extends”Error
Extended by
Section titled “Extended by”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ProviderError( provider, kind, message, opts?): ProviderError;Defined in: core/src/errors.ts:134
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
provider |
string |
kind |
ErrorKind |
message |
string |
opts |
{ body?: string; cause?: unknown; code?: string; resetAtMs?: number; retryAfterMs?: number; shouldRetry?: boolean; status?: number; window?: RateLimitWindow; } |
opts.body? |
string |
opts.cause? |
unknown |
opts.code? |
string |
opts.resetAtMs? |
number |
opts.retryAfterMs? |
number |
opts.shouldRetry? |
boolean |
opts.status? |
number |
opts.window? |
RateLimitWindow |
Returns
Section titled “Returns”ProviderError
Overrides
Section titled “Overrides”Error.constructorProperties
Section titled “Properties”readonly optional body?: string;Defined in: core/src/errors.ts:132
The provider’s own response body, truncated. It carries the actual reason, otherwise lost behind “400 status code (no body)”.
cause?
Section titled “cause?”optional cause?: unknown;Defined in: node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
Section titled “Inherited from”Error.causereadonly optional code?: string;Defined in: core/src/errors.ts:121
readonly kind: ErrorKind;Defined in: core/src/errors.ts:119
message
Section titled “message”message: string;Defined in: node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
Section titled “Inherited from”Error.messagename: string;Defined in: node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
Section titled “Inherited from”Error.nameprovider
Section titled “provider”readonly provider: string;Defined in: core/src/errors.ts:118
resetAtMs?
Section titled “resetAtMs?”readonly optional resetAtMs?: number;Defined in: core/src/errors.ts:126
Absolute reset of the binding limit. Can be days beyond Retry-After.
retryAfterMs?
Section titled “retryAfterMs?”readonly optional retryAfterMs?: number;Defined in: core/src/errors.ts:124
Honoured when the provider said how long to wait (Retry-After, or Gemini’s RetryInfo.retryDelay).
shouldRetry?
Section titled “shouldRetry?”readonly optional shouldRetry?: boolean;Defined in: core/src/errors.ts:129
Explicit server directive (x-should-retry), overriding default classification.
stack?
Section titled “stack?”optional stack?: string;Defined in: node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
Section titled “Inherited from”Error.stackstatus?
Section titled “status?”readonly optional status?: number;Defined in: core/src/errors.ts:120
window?
Section titled “window?”readonly optional window?: RateLimitWindow;Defined in: core/src/errors.ts:127
Accessors
Section titled “Accessors”isBackupEligible
Section titled “isBackupEligible”Get Signature
Section titled “Get Signature”get isBackupEligible(): boolean;Defined in: core/src/errors.ts:167
Returns
Section titled “Returns”boolean
isTransient
Section titled “isTransient”Get Signature
Section titled “Get Signature”get isTransient(): boolean;Defined in: core/src/errors.ts:162
Returns
Section titled “Returns”boolean
Methods
Section titled “Methods”from()
Section titled “from()”static from(provider, err): ProviderError;Defined in: core/src/errors.ts:173
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 |
Returns
Section titled “Returns”ProviderError