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: Sun, 7 Feb 2010 15:14:30 -0000
If anyone was following / interested in this, I made one further discovery. NSExceptionHandler delegates are not called if an exception is raised in a subthread. Instead, the app just silently terminates. Worse, on Snow Leopard Crash Reporter fails to kick in, so you don't even get a crash report. Exit one (potential) customer.
Fortunately, there is a simple solution: use NSSetUncaughtExceptionHandler instead. Although this disables the NSExceptionHandler delegate, that doesn't matter because you can do exactly the same things in your uncaught exception handler so all is well. You still need to call [NSExceptionHandler setExceptionHandlingMask:] to tell Cocoa which exceptions you are interested in, else you never see any.
As per my previous posts, my app seems to run just fine trapping and treating as fatal all exceptions (except system exceptions) in this way, with the proviso that certain exceptions as previously listed must be silently ignored. I sleep a lot better at night knowing that I will get a crash log, rather than mysterious mis-behaviour of my app, if an exception is thrown that I do not explicitly cater for.
Paul Sanders.
_______________________________________________
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