class AI::Provider::InvalidArgumentError

Overview

Error thrown when a function argument is invalid.

This error is raised when a method receives an argument that doesn't meet the expected criteria.

Defined in:

ai/provider/errors/invalid_argument_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(*, argument : String, message : String, cause : Exception | Nil = nil) #

Creates a new InvalidArgumentError.

Parameters:

  • argument: The name of the invalid argument
  • message: The error message describing what's wrong
  • cause: Optional underlying exception

[View source]

Class Method Detail

def self.instance?(error) : Bool #

Checks if the given value is an instance of InvalidArgumentError.


[View source]

Instance Method Detail

def argument : String #

The name of the invalid argument.


[View source]