class AI::Provider::JSONParseError

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.cr

Constructors

Class Method Summary

Instance Method Summary

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

[View source]

Class Method Detail

def self.instance?(error) : Bool #

Checks if the given value is an instance of JSONParseError.


[View source]

Instance Method Detail

def text : String #

The text that failed to parse as JSON.


[View source]