Exception: YogaPants::Connection::HTTPError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- YogaPants::Connection::HTTPError
- Defined in:
- lib/yoga_pants/connection.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(message, response = nil) ⇒ HTTPError
constructor
A new instance of HTTPError.
Constructor Details
#initialize(message, response = nil) ⇒ HTTPError
Returns a new instance of HTTPError.
12 13 14 15 16 17 18 19 20 |
# File 'lib/yoga_pants/connection.rb', line 12 def initialize(, response = nil) @response = response if response @status_code = response.status_code super( + "\nBody: #{response.body}") else super() end end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
11 12 13 |
# File 'lib/yoga_pants/connection.rb', line 11 def response @response end |
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
11 12 13 |
# File 'lib/yoga_pants/connection.rb', line 11 def status_code @status_code end |