Exception: LLM::Error

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/llm/error.rb

Overview

The superclass of all LLM errors

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeError

Returns a new instance of Error.



12
13
14
15
# File 'lib/llm/error.rb', line 12

def initialize(...)
  block_given? ? yield(self) : nil
  super
end

Instance Attribute Details

#responseNet::HTTPResponse?

Returns the response associated with an error, or nil

Returns:

  • (Net::HTTPResponse, nil)

    Returns the response associated with an error, or nil



10
11
12
# File 'lib/llm/error.rb', line 10

def response
  @response
end

Instance Method Details

#messageObject



17
18
19
20
21
22
23
# File 'lib/llm/error.rb', line 17

def message
  if response
    [super, response.body].join("\n")
  else
    super
  end
end