I tried doing this, but it didn’t work. It was obviously rescuing the
exception and the program was still going down at the same point. But
nothing is actualy getting printed to the screen. I think it might be
helped by putting the rescue at a lower level in the trace, but I can’t
because those 9 levels are missing. And going lower than that means
putting the rescue in rexml, which I don’t want to touch.
Ruby should have a command line parameter that tells it to display the
whole backtrace. -v should do it because it puts you in verbose mode,
but it doesn’t. Maybe one of the other options does it, but I don’t
think so.
If you catch the exception yourself, you can print all backtrace levels:
begin
do_something_that_barfs
rescue Exception => err
puts err.class.name + ": " + err.message
puts err.backtrace.join( "\n" )
end