public
Last active

  • Download Gist
asdfasdf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
---------------------------------------------------- Exception#backtrace
exception.backtrace => array
 
From Ruby 1.8
------------------------------------------------------------------------
Returns any backtrace associated with the exception. The backtrace
is an array of strings, each containing either ``filename:lineNo:
in `method''' or ``filename:lineNo.''
 
def a
raise "boom"
end
def b
a()
end
begin
b()
rescue => detail
print detail.backtrace.join("\n")
end
 
_produces:_
 
prog.rb:2:in `a'
prog.rb:6:in `b'
prog.rb:10
 
(END)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.