Exception: Fog::HP::Errors::ServiceError
- Inherits:
-
Errors::Error
- Object
- StandardError
- Errors::Error
- Fog::HP::Errors::ServiceError
- Defined in:
- lib/fog/hp.rb
Direct Known Subclasses
BadRequest, Conflict, Forbidden, InternalServerError, NotFound, ServiceUnavailable
Instance Attribute Summary collapse
-
#response_data ⇒ Object
readonly
Returns the value of attribute response_data.
Attributes inherited from Errors::Error
Class Method Summary collapse
Instance Attribute Details
#response_data ⇒ Object (readonly)
Returns the value of attribute response_data.
15 16 17 |
# File 'lib/fog/hp.rb', line 15 def response_data @response_data end |
Class Method Details
.slurp(error) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/fog/hp.rb', line 17 def self.slurp(error) if error.response.body.empty? data = nil = nil else begin data = Fog::JSON.decode(error.response.body) = data['message'] if .nil? and !data.values.first.nil? = data.values.first['message'] end rescue MultiJson::DecodeError = error.response.body #### body is not in JSON format, so just return as is end end new_error = super(error, ) new_error.instance_variable_set(:@response_data, data) new_error end |