Creates a new AIError instance.
AI error construction options including provider context.
ReadonlyattemptedReadonlycodeReadonlydetailsReadonlymodelReadonlyproviderReadonlyretryableReadonlyseverityReadonlysuggestionsReadonlytimestampReadonlytokenReturns structured context for AI agents with provider diagnostics.
Base AI context plus provider, model, and tokenUsage
fields to enable LLM self-healing and retry decisions.
Serializes the error to a JSON-safe object with AI provider fields.
Base fields plus provider, model, and tokenUsage.
Error subclass for AI provider failures.
Ai Context
AI provider failure context enabling LLM self-healing
Example