Exception: Bamboozled::HTTPError
- Inherits:
-
StandardError
- Object
- StandardError
- Bamboozled::HTTPError
- Defined in:
- lib/bamboozled/errors.rb
Direct Known Subclasses
AuthenticationFailed, BadRequest, Conflict, Forbidden, GatewayError, InformBamboo, InternalServerError, LimitExceeded, NotAcceptable, NotFound, ServiceUnavailable, Unauthorized
Instance Attribute Summary collapse
-
#hint ⇒ Object
readonly
Returns the value of attribute hint.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(response, params = {}, hint = nil) ⇒ HTTPError
constructor
A new instance of HTTPError.
- #to_s ⇒ Object
Constructor Details
#initialize(response, params = {}, hint = nil) ⇒ HTTPError
Returns a new instance of HTTPError.
7 8 9 10 11 12 |
# File 'lib/bamboozled/errors.rb', line 7 def initialize(response, params = {}, hint = nil) @response = response @params = params @hint = hint super(response) end |
Instance Attribute Details
#hint ⇒ Object (readonly)
Returns the value of attribute hint.
5 6 7 |
# File 'lib/bamboozled/errors.rb', line 5 def hint @hint end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
4 5 6 |
# File 'lib/bamboozled/errors.rb', line 4 def params @params end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
3 4 5 |
# File 'lib/bamboozled/errors.rb', line 3 def response @response end |
Instance Method Details
#to_s ⇒ Object
14 15 16 17 18 |
# File 'lib/bamboozled/errors.rb', line 14 def to_s "#{self.class} : #{response.code} #{response.body}".tap do |msg| msg << "\n#{hint}" if hint end end |