S
Simon Strandgaard
I want to attach debug information to some of my exceptions, however I
have problems transfering the backtrace array from the original to the new
exception. It seems as #set_backtrace doesn't have any effect?
What am I doing wrong?
Any suggestions how to do such thing?
I would have expected the output of following snippet to contain
these a:0:A b:1:B c:2:C entries.. but that doesn't happen.
server> ruby a.rb
a.rb:17:in `mk_problem': we got nuked (TolerantError)
from a.rb:19
server> expand -t2 a.rb
def trigger
raise "dodge this"
end
def dropbomb
trigger
end
def transportbomb
dropbomb
end
class TolerantError < StandardError; end
def mk_problem
transportbomb
rescue => e
#p e.backtrace
error = TolerantError.new("we got nuked")
error.set_backtrace(%w(a:0:A b:1:B c:2:C))
raise error
end
mk_problem
server>
have problems transfering the backtrace array from the original to the new
exception. It seems as #set_backtrace doesn't have any effect?
What am I doing wrong?
Any suggestions how to do such thing?
I would have expected the output of following snippet to contain
these a:0:A b:1:B c:2:C entries.. but that doesn't happen.
server> ruby a.rb
a.rb:17:in `mk_problem': we got nuked (TolerantError)
from a.rb:19
server> expand -t2 a.rb
def trigger
raise "dodge this"
end
def dropbomb
trigger
end
def transportbomb
dropbomb
end
class TolerantError < StandardError; end
def mk_problem
transportbomb
rescue => e
#p e.backtrace
error = TolerantError.new("we got nuked")
error.set_backtrace(%w(a:0:A b:1:B c:2:C))
raise error
end
mk_problem
server>