In [email protected]
“Re: [ruby-gnome2-devel-en] Capture exception in a rescue block” on
Fri, 20 Jan 2012 14:38:27 +0100,
Simon A. [email protected] wrote:
You mean it would be bad to allow people to rescue from such an
exception ? So you ensure you are exiting the ruby script ?
Because, if you replace exit_application code with just raise, it works
to get the backtrace.
Could you show an example script?
Here are 3 samples.
they override GLib::exit_application to use :
The first two shows the backtrace. You can get rid if the rescue close,
and it will show the usual ruby backtrace, or add raise at the end of
The third one does nothing, as expected.
Gtk::Button’s clicked signal is a no problem case. Because
the signal doesn’t require return value. (We may be able to
avoid calling #exit_application for those signal handlers.)
There are many signals that requires return value. For
example, “expose-event” requires boolean return value. If we
got an exception, we can’t chose what value should be
Another example is GLib::Timeout.add, GLib::Idle.add and so
on but they don’t call #exit_application. :< We should fix
them by calling rbgutil_invoke_callback()…