Željko Filipin Željko Filipin -4 years ago 185
Ruby Question

How to force ruby to show full stack trace?

I just got this error message:

...
from c:/ruby/lib/ruby/gems/1.8/gems/...
... 10 levels...
from c:/ruby/lib/ruby/gems/1.8/gems/...
...


and the bug (of course) is hidden somewhere in
... 10 levels...
.

How to force ruby to show full stack trace?

Answer Source
begin
  # code that raises exception
rescue StandardError => e
  puts e.backtrace
end
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download