class AI::Provider::AISDKError

Overview

Base error class for all AI SDK errors.

All AI SDK specific errors inherit from this class, allowing for consistent error handling and type checking.

Direct Known Subclasses

Defined in:

ai/provider/errors/ai_sdk_error.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(*, name : String, message : String, cause : Exception | Nil = nil) #

Creates a new AISDKError.

Parameters:

  • name: The name of the error type
  • message: The error message
  • cause: Optional underlying exception that caused this error

[View source]

Class Method Detail

def self.instance?(error) : Bool #

Checks if the given value is an instance of AISDKError.

This method enables checking if an error is an AI SDK error without needing direct type comparison.


[View source]

Instance Method Detail

def name : String #

The name of the error type (e.g., "AI_APICallError").


[View source]
def to_s(io : IO) : Nil #

Returns a string representation of the error.


[View source]