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" <p.sand...@alpinesoft.co.uk>
To: <cocoa-dev@lists.apple.com>
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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to