1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[ec2] pass through backtrace when reraising ec2 errors

This commit is contained in:
geemus 2010-05-26 14:45:44 -07:00
parent 79767e6144
commit eff7978b64

View file

@ -226,7 +226,9 @@ module Fog
})
rescue Excon::Errors::Error => error
if match = error.message.match(/<Code>(.*)<\/Code><Message>(.*)<\/Message>/)
raise Fog::AWS::EC2::Error.new("#{match[1]} => #{match[2]}")
new_error = Fog::AWS::EC2::Error.new("#{match[1]} => #{match[2]}")
new_error.set_backtrace(error.backtrace)
raise new_error
else
raise error
end