Methods

Class/Module Index [+]

Quicksearch

Fog::AWS::Errors

Public Class Methods

match_error(error) click to toggle source
# File lib/fog/aws/core.rb, line 312
def self.match_error(error)
  matcher = lambda {|s| s.match(/(?:.*<Code>(.*)<\/Code>)(?:.*<Message>(.*)<\/Message>)/)}
  [error.message, error.response.body].each(&Proc.new {|s|
    match = matcher.call(s)
    return {:code => match[1].split('.').last, :message => match[2]} if match
  })
  {} # we did not match the message or response body
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.