When I get exceptions, it is often from deep within the call stack. When this happens, more often than not, the actual offending line of code is hidden from me:
Exception#backtrace has the entire stack in it:
def do_division_by_zero; 5 / 0; end begin do_division_by_zero rescue => exception puts exception.backtrace raise # always reraise end
(Inspired by Peter Cooper's Ruby Inside blog)