Re: Uncaught exceptions not terminating my app
Re: Uncaught exceptions not terminating my app
- Subject: Re: Uncaught exceptions not terminating my app
- From: Jens Alfke <email@hidden>
- Date: Thu, 28 Jan 2010 08:34:40 -0800
On Jan 28, 2010, at 12:10 AM, Paul Sanders wrote:
> If you don't crash the app, you don't get the stack trace. No
> stack trace = no clue about what went wrong.
That's why I said the error alert should include the same "Report" button as the crash report would.
> And we do offer to
> save the user's work (in the NSExceptionHandler delegate) before
> we bail out.
That's fairly dangerous. At that point you have no idea what's on the stack or what operations are halfway done. If you're doing inside a half-completed AppKit or HLTB call, putting up any UI creates re-entrant calls. If you're inside your own code, you're calling yourself re-entrantly when you save.
It's safer to save away the exception info, let the stack unwind fully, and then on the next runloop cycle put up the alert:
http://bitbucket.org/snej/myutilities/src/tip/ExceptionUtils.m
—Jens_______________________________________________
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