Exception: OmniAI::HTTPError
- Defined in:
- lib/omniai/http_error.rb
Overview
An error that wraps an HTTP::Response for non-OK requests.
Direct Known Subclasses
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(response) ⇒ HTTPError
constructor
A new instance of HTTPError.
- #inspect ⇒ String
Constructor Details
#initialize(response) ⇒ HTTPError
Returns a new instance of HTTPError.
11 12 13 14 15 |
# File 'lib/omniai/http_error.rb', line 11 def initialize(response) super("status=#{response.status} body=#{response.body}") @response = response end |
Instance Attribute Details
#response ⇒ HTTP::Response
8 9 10 |
# File 'lib/omniai/http_error.rb', line 8 def response @response end |
Instance Method Details
#inspect ⇒ String
18 19 20 |
# File 'lib/omniai/http_error.rb', line 18 def inspect "#<#{self.class} status=#{@response.status} body=#{@response.body}>" end |