discuss-gnustep
[Top][All Lists]
Advanced

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

-gui Uncaught Exception Handler (Was: Getting UTF-8 value of string occa


From: David Ayers
Subject: -gui Uncaught Exception Handler (Was: Getting UTF-8 value of string occasionally fails)
Date: Wed, 13 Oct 2004 14:38:29 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.1) Gecko/20040707

Christopher Culver wrote:

> In developing Charmap I have encountered several Unicode positions
> where getting calling -UTF8String on a string consisting solely of
> that position's character results in:
> 
> "Uncaught exception NSCharacterConversionException, reason: Can't get
> UTF8 from Unicode string."
> 
> Even clicking on Ignore crashes the application.
> 

Sorry Christopher,

this does not address your issue.  I've also recently looked into a
report in which the user thought that pressing "Ignore" in the panel of
gui's uncaught exception handler should somehow magically put the
application in some defined state.

The uncaught exception handler comes into play when an exception is
raised outside of any NS_DURING/NS_HANDLER contexts and would therefor
normally crash the application.  Hence the name "Uncaught Exception
Handler" :-).  Developers generally (if not always) assume that call to
-raise (or failing NS(C)Assert or what have you) will /never/ return.
Yet that is exactly what hitting "Ignore" will do.

It seems absurd to raise an exception yet have the call to raise return.
 OTOH, it also seems that during development some people find this
useful and it just happens to work often anyway.

I personally would endorse removing the "Ignore" option all together (or
guard it with some define/default that doesn't use it by default.)  But
in any case, the dialog should make it painfully clear, that selecting
"Ignore" will produce undefined behavior, as the author of the code that
called -raise did not expect the call to return.

Lest I here objections, I'll prepare a patch to address this somehow.
Please let my know you preferences.

Cheers,
David





reply via email to

[Prev in Thread] Current Thread [Next in Thread]