Exception: Almodovar::HttpError
- Inherits:
-
StandardError
- Object
- StandardError
- Almodovar::HttpError
- Defined in:
- lib/almodovar/errors.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#response_body ⇒ Object
readonly
Returns the value of attribute response_body.
-
#response_headers ⇒ Object
readonly
Returns the value of attribute response_headers.
-
#response_status ⇒ Object
readonly
Returns the value of attribute response_status.
-
#response_url ⇒ Object
readonly
Returns the value of attribute response_url.
Instance Method Summary collapse
-
#initialize(response, url, query_params = {}) ⇒ HttpError
constructor
Children of this class must not override the initialize method.
Constructor Details
#initialize(response, url, query_params = {}) ⇒ HttpError
Children of this class must not override the initialize method
6 7 8 9 10 11 12 13 14 |
# File 'lib/almodovar/errors.rb', line 6 def initialize(response, url, query_params = {}) @response_status = response.status @response_body = response.body @response_headers = response.headers @response_url = url = "Status code #{response.status} on resource #{url}" += " with params: #{query_params.inspect}" if query_params.present? super() end |
Instance Attribute Details
#response_body ⇒ Object (readonly)
Returns the value of attribute response_body.
3 4 5 |
# File 'lib/almodovar/errors.rb', line 3 def response_body @response_body end |
#response_headers ⇒ Object (readonly)
Returns the value of attribute response_headers.
3 4 5 |
# File 'lib/almodovar/errors.rb', line 3 def response_headers @response_headers end |
#response_status ⇒ Object (readonly)
Returns the value of attribute response_status.
3 4 5 |
# File 'lib/almodovar/errors.rb', line 3 def response_status @response_status end |
#response_url ⇒ Object (readonly)
Returns the value of attribute response_url.
3 4 5 |
# File 'lib/almodovar/errors.rb', line 3 def response_url @response_url end |