#!/usr/bin/env ruby
def foo
raise ArgumentError, "It's broken"
end
def bar
foo
rescue
raise
end
begin
bar
rescue
puts $!.backtrace
end
exception.rb:4:in `foo'
exception.rb:8:in `bar'
exception.rb:14:in `<main>'
exception.rb:10:in `bar'
exception.rb:14:in `<main>'
This is caused by our lazy backtraces I think. Re-raising needs to force them, possibly.
It makes debugging tricky.
@chrisseaton this would be fixed. I personally agree with @ioquatix this is tricky. I noticed it in many cases and it's really confusing in some point.
I'll take a look at this.
I fixed it in 71b186f561b68e321a75e6f22063273cca5d9405, this was indeed caused by the lazy backtraces, which need special care when re-raising an existing exception.
The fix will be in the next release, thank you for the report and easy-to-reproduce example!
Most helpful comment
I fixed it in 71b186f561b68e321a75e6f22063273cca5d9405, this was indeed caused by the lazy backtraces, which need special care when re-raising an existing exception.
The fix will be in the next release, thank you for the report and easy-to-reproduce example!