Skip to content

Commit

Permalink
[ec2] pass through backtrace when reraising ec2 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
geemus committed May 26, 2010
1 parent 79767e6 commit eff7978
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/fog/aws/ec2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,9 @@ def request(params)
})
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
Expand Down

0 comments on commit eff7978

Please sign in to comment.