Re: Build problem Gtk2-1.037



muppet <scott asofyet org> writes:

- The idea of trapping exceptions during main loops has precedent
(Event.pm).  There are also technical reasons (if you jump past a
gtk_main() stack frame you can't get out of it).

with perl-GTK and with our patch, we expect this and indeed one has to
run another gtk_main if he wants to rerun an wait-for-events loop
 
- Given the above, you can very easily install an exception handler
that kills the main loop and cleans up properly.

this is actually what do ugtk2 package :-)

we just put the needed infrastructure in perl-glib to be able to do
that: install_exception_handler()/remove_exception_handler() is still
availlable and still works smoothly!

we just enable either to use the classic "treat errors where it
happens" way or the exceptions throwing/trapping way

It's difficult to the point of senselessness to get the semantics of
this right in a library, because it's truly the app's
responsibility.

Checking $wizard_canceled is no different from checking $@, after
all.

then, we've to deal both with $@ for errors that happened pre or post
wizard stuff and with $wizard_canceled (not that much a worry but less
elegant).

Of course, how you implement that depends completely on how your app
is defined and how you do things.


our solution did fix quite some issues like gratuitous ERRSV
clobberin and the like that i'd to send fixes again.

i applied your patch that avoids clobbering $@, and the most recent
change was to avoid clobbering $_.

i do know but i wanted to show ross about not being so pedant about
distro "dramatic errors" and "stupid apps designs" when he's not even
able to see immediate flaws in upstream design (yes, that's somewhat
trollistic but i got upset when i read his post :-()

if there are others, please send them.

they're no more.

you choose to ignore all errors by default which is an insane
policy as far as i'm concerned.

Technically, we don't ignore all errors by default.  We *trap*
exceptions that go uncaught and would otherwise cause extreme
breakage; by precedent for event-based system we do not kill the
event loop, but we do also give you a hook to handle those
exceptions, so they are far from ignored.

"technically" yes.

from usual way of dealing with them in perl, no.

i really think that we should exit the perl interpreter when an error
is not dealed with.
if one does not want to deal with them, he just has to set an
exception handler, but others can behave the way they want.

The one failing i see is that if you have any exception handlers
installed, you won't get warnings, regardless of whether the
exception is "handled".  I'm open to proposals for fixing that, but
be quick, as our freeze date is *today*.

the patch we apply in our perl-glib package is to enable both your
global exception handler way or to enable the user to exit the gtk
loop.

actually, we can alter the initialization code from ugtk2 to use your
infrastructure in order to set the "exit gtk+ event loop" (i just
tested it) but the feature we lacks is "exiting perl with a trace on
the the console" so that unhandled errors lead to immediate exit
like in any other app (which is currently not possible due to the fact
exception handler is run with G_EVAL)

though we can play with Gtk2->main_level, print and exit in exception
handler...




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]