How to log the line in which the error/exception occurred?

Hi, I log errors/exception into a Thread in this way:

                   Thread.new {

                                begin
                        Logic::process(data)
                                rescue => e
                                        puts “#{e.class}: #{$!}”
                                end
            }

but it doesn’t show in which file and line the problem occurs, how to
show it?

Thanks a lot.

El Lunes, 21 de Julio de 2008, Iñaki Baz C. escribió:

but it doesn’t show in which file and line the problem occurs, how to show
it?

Thanks a lot.

The solution is:

puts $!.backtrace

:slight_smile: