class
AI::Provider::InvalidResponseDataError
- AI::Provider::InvalidResponseDataError
- AI::Provider::AISDKError
- Exception
- Reference
- Object
Overview
Error thrown when the server returns a response with invalid data content.
This should be thrown by providers when they cannot parse the response from the API.
Defined in:
ai/provider/errors/invalid_response_data_error.crConstructors
-
.new(*, data, message : String | Nil = nil)
Creates a new InvalidResponseDataError.
Class Method Summary
-
.instance?(error) : Bool
Checks if the given value is an instance of InvalidResponseDataError.
Instance Method Summary
-
#data : JSON::Any | Nil
The invalid response data.
Instance methods inherited from class AI::Provider::AISDKError
name : String
name,
to_s(io : IO) : Nil
to_s
Constructor methods inherited from class AI::Provider::AISDKError
new(*, name : String, message : String, cause : Exception | Nil = nil)
new
Class methods inherited from class AI::Provider::AISDKError
instance?(error) : Bool
instance?
Constructor Detail
def self.new(*, data, message : String | Nil = nil)
#
Creates a new InvalidResponseDataError.
Parameters:
- data: The invalid response data (any type)
- message: Optional custom message (defaults to formatted data representation)
Class Method Detail
def self.instance?(error) : Bool
#
Checks if the given value is an instance of InvalidResponseDataError.