##
runtime error at - line 6.
the transaction failed at - line 23
main::sub3() called at - line 3
main::sub1() called at - line 13
main::main_sub() called at - line 27
####
def dying_sub
raise RuntimeError, "reason here"
end
def main
begin
dying_sub()
rescue RuntimeError => e
STDERR.puts e.backtrace
end
end
main()
# Output:
# test.rb:2:in `dying_sub'
# test.rb:7:in `main'
# test.rb:13