Date: Mon, 22 Sep 2003 09:32:34 +0100 Cc: lablgtk at kaba.or.jp Subject: Re: Exception handling bug in GMain.Main (was: Re: Trapping exceptions at the top level? (repost)) Message-ID: <20030922083234.GA26584 at redhat.com> References: <16234.5256.398860.836871 at karryall.dnsalias.org> <20030919082312.GA32760 at redhat.com> <16234.49739.381798.15267 at akasha.ijm.jussieu.fr> <20030922094608Y.garrigue at kurims.kyoto-u.ac.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030922094608Y.garrigue at kurims.kyoto-u.ac.jp> From: Richard Jones On Mon, Sep 22, 2003 at 09:46:08AM +0900, Jacques Garrigue wrote: > From: Olivier Andrieu > > Richard Jones [Friday 19 September 2003] : > > > > > > On Thu, Sep 18, 2003 at 10:24:40PM +0200, Olivier Andrieu wrote: > > > > | let _ = GtkSignal.user_exn_handler := my_exn_handler > > > > > > user_exn_handler is something you added? > > > > Yes, here's a patch. But maybe Jacques has a better solution than just > > trapping every exception. > > Considering the expected semantics of GTK callbacks, I suppose this is > the only reasonable thing to do. > I must admit that I never really considered the problem, even while > writing even subtler code for handling of return values. Yes, I think the reason this works is that for most small programs exceptions cause the program to exit. In such a situation the problem would never arise. We want to trap those exceptions and display a suitable message instead. The fact is that we're also getting exceptions when external conditions fail (in particular, when OLE fails to work, or when Windows mysteriously decides to bitrot in some way). Rich. -- Richard Jones. http://www.annexia.org/ http://freshmeat.net/users/rwmj Merjis Ltd. http://www.merjis.com/ - all your business data are belong to you. 'There is a joke about American engineers and French engineers. The American team brings a prototype to the French team. The French team's response is: "Well, it works fine in practice; but how will it hold up in theory?"'