Exception: OmniAI::HTTPError

Inherits:
Error
  • Object
show all
Defined in:
lib/omniai.rb

Overview

An error that wraps an HTTP::Response for non-OK requests.

Direct Known Subclasses

Chat::URL::FetchError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ HTTPError

Returns a new instance of HTTPError.

Parameters:

  • response (HTTP::Response)


24
25
26
27
28
# File 'lib/omniai.rb', line 24

def initialize(response)
  super("status=#{response.status} body=#{response.body}")

  @response = response
end

Instance Attribute Details

#responseHTTP::Response

Returns:

  • (HTTP::Response)


21
22
23
# File 'lib/omniai.rb', line 21

def response
  @response
end

Instance Method Details

#inspectObject



30
31
32
# File 'lib/omniai.rb', line 30

def inspect
  "#<#{self.class} status=#{@response.status} body=#{@response.body}>"
end