backtrace

exception.backtrace â array
Instance Public methods

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
doc_ruby_on_rails
2015-04-05 13:48:05
Comments
Leave a Comment

Please login to continue.