Thursday, June 7, 2012

Ruby: Printing the current stacktrace

begin
  Math.sqrt(-1)  # any error will do
rescue => e
  puts e.inspect
  puts e.backtrace
end



http://www.ruby-forum.com/topic/125107