Documentation / @agentick/shared / AdapterError
Class: AdapterError ​
Defined in: errors.ts:529
Error thrown by model adapters for provider-specific errors.
Example ​
throw new AdapterError('openai', 'No message in response', 'ADAPTER_RESPONSE');
throw new AdapterError('google', 'Rate limit exceeded', 'ADAPTER_RATE_LIMIT', { retryAfter: 60 });
throw new AdapterError('anthropic', 'Content blocked', 'ADAPTER_CONTENT_FILTER');Extends ​
Constructors ​
Constructor ​
new AdapterError(
provider,message,code?,details?,cause?):AdapterError
Defined in: errors.ts:536
Parameters ​
provider ​
string
message ​
string
code? ​
"ADAPTER_RESPONSE" | "ADAPTER_RATE_LIMIT" | "ADAPTER_AUTH" | "ADAPTER_CONTENT_FILTER" | "ADAPTER_CONTEXT_LENGTH"
details? ​
Record<string, unknown> = {}
cause? ​
Error
Returns ​
AdapterError
Overrides ​
Properties ​
cause? ​
readonlyoptionalcause:Error
Defined in: errors.ts:108
Original error that caused this error
Inherited from ​
code ​
readonlycode:AgentickErrorCode
Defined in: errors.ts:102
Unique error code for programmatic handling
Inherited from ​
details ​
readonlydetails:Record<string,unknown>
Defined in: errors.ts:105
Additional error details
Inherited from ​
provider ​
readonlyprovider:string
Defined in: errors.ts:531
Provider name (openai, google, anthropic, etc.)
providerErrorCode? ​
readonlyoptionalproviderErrorCode:string
Defined in: errors.ts:534
Provider-specific error code
Methods ​
contentFiltered() ​
staticcontentFiltered(provider,reason?):AdapterError
Defined in: errors.ts:569
Create a content filter error
Parameters ​
provider ​
string
reason? ​
string
Returns ​
AdapterError
contextLength() ​
staticcontextLength(provider,maxTokens,requestedTokens?):AdapterError
Defined in: errors.ts:581
Create a context length error
Parameters ​
provider ​
string
maxTokens ​
number
requestedTokens? ​
number
Returns ​
AdapterError
fromJSON() ​
staticfromJSON(json):AgentickError
Defined in: errors.ts:169
Create error from serialized format
Parameters ​
json ​
Returns ​
Inherited from ​
rateLimit() ​
staticrateLimit(provider,retryAfter?):AdapterError
Defined in: errors.ts:557
Create a rate limit error
Parameters ​
provider ​
string
retryAfter? ​
number
Returns ​
AdapterError
toJSON() ​
toJSON():
SerializedAgentickError
Defined in: errors.ts:137
Serialize error for transport (JSON-safe)