Methods

Class/Module Index [+]

Quicksearch

Fog::Rackspace::Errors::ServiceError

Attributes

response_data[R]
status_code[R]

Public Class Methods

slurp(error) click to toggle source
# File lib/fog/rackspace.rb, line 16
def self.slurp(error)
  data = nil
  message = nil
  status_code = nil

  if error.response
    status_code = error.response.status
    unless error.response.body.empty?
      data = Fog::JSON.decode(error.response.body)
      message = data.values.first ? data.values.first['message'] : data['message']
    end
  end

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

Public Instance Methods

to_s() click to toggle source
# File lib/fog/rackspace.rb, line 12
def to_s
  status_code ? "[HTTP #{status_code}] #{super}" : super
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.