Re: Uncaught exceptions not terminating my app
Re: Uncaught exceptions not terminating my app
- Subject: Re: Uncaught exceptions not terminating my app
- From: "Paul Sanders" <email@hidden>
- Date: Fri, 19 Feb 2010 15:22:56 -0000
Just a quick update on this for anyone still interested. To the list of exceptions to explicitly ignore in your uncaught exception handler, include NSPortTimeoutExceptions. These happen (rarely) when the spell checking service is busy or slow to start up (I'm not sure which, it's happening on a customer's machine). There are also probably other cases, although we haven't seen any. Other than that, and a one-off crash on Tiger that actually looks like a Tiger bug, the scheme is working well, in the sense that one learns interesting things without inconveniencing users unduly.
Paul Sanders.
http://www.alpinesoft.co.uk
----- Original Message -----
From: "Paul Sanders" <email@hidden>
To: <email@hidden>
Sent: Wednesday, January 27, 2010 7:01 PM
Subject: Re: Uncaught exceptions not terminating my app
Here's the list of exceptions I silently ignore in my NSExceptionHandler delegate:
-----------------------------------------------------------------------
NSString *nss_exception_name = [exception name];
NSString *nss_reason = [exception reason];
if ([nss_exception_name isEqualToString: NSAccessibilityException])
return YES;
if ([nss_exception_name isEqualToString: NSInternalInconsistencyException])
{
if (gIsTiger) // Happens on startup, apparently a Tiger bug
{
// __T ("lockFocus sent to a view whose window is ")
// __T ("deferred and does not yet have a corresponding platform window")
if ([nss_reason hasPrefix: @"lockFocus sent to a view whose window is deferred"])
return YES;
}
// Happens occasionally during testing (on 10.5.8), plus one crash reported in the field
if ([nss_reason hasPrefix: @"Invalid message sent to event \"NSEvent: type=LMouseUp"])
return YES;
if ([nss_reason hasPrefix: @"Invalid message sent to event \"NSEvent: type=RMouseUp"])
return YES;
// Seen this once in the field:
if ([nss_reason hasPrefix: @"Failed to get KeyCode from EventRef"])
return YES;
}
// Display bye-bye message to the user, maybe offer to save her work if U R feeling brave.
* (int *) 1 = 0;
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden