class
AI::Provider::AISDKError
- AI::Provider::AISDKError
- Exception
- Reference
- Object
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
- AI::OpenAI::OpenAIError
- AI::Provider::APICallError
- AI::Provider::EmptyResponseBodyError
- AI::Provider::InvalidArgumentError
- AI::Provider::InvalidPromptError
- AI::Provider::InvalidResponseDataError
- AI::Provider::JSONParseError
- AI::Provider::LoadAPIKeyError
- AI::Provider::LoadSettingError
- AI::Provider::NoContentGeneratedError
- AI::Provider::NoSuchModelError
- AI::Provider::TooManyEmbeddingValuesForCallError
- AI::Provider::TypeValidationError
- AI::Provider::UnsupportedFunctionalityError
Defined in:
ai/provider/errors/ai_sdk_error.crConstructors
-
.new(*, name : String, message : String, cause : Exception | Nil = nil)
Creates a new AISDKError.
Class Method Summary
-
.instance?(error) : Bool
Checks if the given value is an instance of AISDKError.
Instance Method Summary
-
#name : String
The name of the error type (e.g., "AI_APICallError").
-
#to_s(io : IO) : Nil
Returns a string representation of the error.
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
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.