Exception: Fog::Rackspace::Errors::ServiceError

Inherits:
Errors::Error
  • Object
show all
Defined in:
lib/fog/rackspace.rb

Instance Attribute Summary collapse

Attributes inherited from Errors::Error

#verbose

Class Method Summary collapse

Instance Attribute Details

#response_dataObject (readonly)

Returns the value of attribute response_data.



9
10
11
# File 'lib/fog/rackspace.rb', line 9

def response_data
  @response_data
end

Class Method Details

.slurp(error) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/fog/rackspace.rb', line 11

def self.slurp(error)
  if error.response.body.empty?
    data = nil
    message = nil
  else
    data = Fog::JSON.decode(error.response.body)
    message = data['message']
  end

  new_error = super(error, message)
  new_error.instance_variable_set(:@response_data, data)
  new_error
end