Exception: Brocktail::HTTPError
- Inherits:
-
StandardError
- Object
- StandardError
- Brocktail::HTTPError
- Defined in:
- lib/brocktail/errors.rb
Direct Known Subclasses
BadRequest, InformHarvest, NotFound, RateLimited, ServerError, Unavailable
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(response) ⇒ HTTPError
constructor
A new instance of HTTPError.
- #to_s ⇒ Object
Constructor Details
#initialize(response) ⇒ HTTPError
Returns a new instance of HTTPError.
8 9 10 11 |
# File 'lib/brocktail/errors.rb', line 8 def initialize(response) @response = response super end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
6 7 8 |
# File 'lib/brocktail/errors.rb', line 6 def response @response end |
Instance Method Details
#to_s ⇒ Object
13 14 15 16 |
# File 'lib/brocktail/errors.rb', line 13 def to_s hint = response.headers["hint"].nil? ? nil : response.headers["hint"].first "#{self.class.to_s} : #{response.code}#{" - #{hint}" if hint}" end |