From: Fredrik Jagenheim Date: 2003-08-25T05:21:12+09:00 Subject: fxRuby and errors Hi, I just started to make my first 'real' application using Ruby and fxRuby as a GUI. I've noticed that if I kill my application using Ctrl-C instead of killing it through the windowmanager, I don't get any errors raised. My application runs in a thread separate from the GUI thread, as shown here: ---===--- application = FXApp.new('Foo') window = Window.new(application) application.create thread = Thread.new { runTrueApplication } application.run thread.join ===---=== If 'runTrueApplication' raises something I'd think would be considered a 'fatal' error, namely that it tries to call a method that doesn't exist (raises NoSuchMethod, IIRC) I don't get to know about that error. Only after I kill the application by closing the window I get the error message printed to stderr. Interrupting the process with Ctrl-C just kills the program and nothing gets printed out. This leads me to think that I've missed something important about how Threads and Exceptions play together. Could someone please straight this out for me? I guess thread.join is the key? It collects all thrown exceptions? Is there a way for me to know about thrown errors /before/ thread.join? Apart from; [...] thread = Thread.new { begin runTrueApplication rescue puts "Something happened that you should know about: #{$!}" end } TIA, //F, switches between {} and begin/end all the time. ;)