From: "Iñaki Baz Castillo" Date: 2008-07-21T07:05:12+09:00 Subject: Re: Why Thread.abort_on_exception = yes doesn't show errors? [SOLVED] El Domingo, 20 de Julio de 2008, Iñaki Baz Castillo escribió: > As you see, I need the TCP connection remains open and available ALL the > time, I can wait to process the last received data, so I run a Thread and > repeat **inmediately** the loop. > > Also I need that if an exception occurs in Logic::process(data) it being > shown but don't stop the programm (abort_on_exception = false). But in this > way I can't see the error output if it occurs. > > How could I get showing the error into the Thread without doing a "join"? > (I can't do a join). > > Thanks a lot for any suggestion. Opss, I think I have the solution :) --------------------------------- class GServer # New Thread for a new IO. def serve(io) loop do data = read_IO_incoming_data() Thread.new { begin Logic::process(data) rescue => e puts "#{e.class}: #{$!}" end } end # loop end # def serve end # class GServer ------------------------------- Is it OK? :) -- Iñaki Baz Castillo