AnthropicError
Anthropic error metadata augmentation.
Provides Anthropic-specific metadata fields for AI error types through module augmentation, enabling typed access to Anthropic error details.
Models
AnthropicErrorMetadata type
Added in v4.0.0
Source
Signature
type AnthropicErrorMetadata = {
readonly errorType: string | null;
readonly requestId: string | null;
};AnthropicRateLimitMetadata type
Added in v4.0.0
Source
Anthropic-specific rate limit metadata fields.
Details
Extends base error metadata with rate limit-specific information from Anthropic's rate limit headers.
Signature
type AnthropicRateLimitMetadata = AnthropicErrorMetadata & {
readonly requestsLimit: number | null;
readonly requestsRemaining: number | null;
readonly requestsReset: string | null;
readonly tokensLimit: number | null;
readonly tokensRemaining: number | null;
readonly tokensReset: string | null;
};
Anthropic-specific error metadata fields.
Details
Contains the Anthropic error type and request identifier copied from provider error responses when available. Either field may be
nullwhen Anthropic does not include it or the response cannot be decoded.See
AnthropicRateLimitMetadatafor rate-limit responses that also include parsed Anthropic rate-limit headers