class
AI::Provider::JSONParseError
- AI::Provider::JSONParseError
- AI::Provider::AISDKError
- Exception
- Reference
- Object
Overview
Error thrown when JSON parsing fails.
This error provides context about the text that failed to parse and the underlying parsing error.
Defined in:
ai/provider/errors/json_parse_error.crConstructors
-
.new(*, text : String, cause : Exception)
Creates a new JSONParseError.
Class Method Summary
-
.instance?(error) : Bool
Checks if the given value is an instance of JSONParseError.
Instance Method Summary
-
#text : String
The text that failed to parse as JSON.
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(*, text : String, cause : Exception)
#
Creates a new JSONParseError.
Parameters:
- text: The text that failed to parse
- cause: The underlying parsing exception