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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ HTTPError

Returns a new instance of HTTPError.

Parameters:

  • response (HTTP::Response)


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

def initialize(response)
  super("status=#{response.status.inspect} headers=#{response.headers.inspect} body=#{response.body}")
  @response = response
end

Instance Attribute Details

#responseObject

Returns the value of attribute response.



16
17
18
# File 'lib/omniai.rb', line 16

def response
  @response
end