Exception: CrmpClient::HttpError
- Inherits:
-
CrmpClientError
- Object
- StandardError
- CrmpClientError
- CrmpClient::HttpError
- Defined in:
- lib/crmp_client/errors.rb
Overview
Class to wrap errors caused by unexpected HTTP status codes
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Instance Method Summary collapse
-
#initialize(code, body) ⇒ HttpError
constructor
A new instance of HttpError.
- #message ⇒ Object
Constructor Details
#initialize(code, body) ⇒ HttpError
Returns a new instance of HttpError.
11 12 13 14 15 |
# File 'lib/crmp_client/errors.rb', line 11 def initialize(code, body) super() @code = code @body = body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
9 10 11 |
# File 'lib/crmp_client/errors.rb', line 9 def body @body end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
9 10 11 |
# File 'lib/crmp_client/errors.rb', line 9 def code @code end |
Instance Method Details
#message ⇒ Object
17 18 19 |
# File 'lib/crmp_client/errors.rb', line 17 def "HTTP code [#{@code}], response cody [#{@body}]" end |