Re: Exceptions never reach my uncaught exception handler
Re: Exceptions never reach my uncaught exception handler
- Subject: Re: Exceptions never reach my uncaught exception handler
- From: Douglas Davidson <email@hidden>
- Date: Wed, 23 Jan 2002 12:16:05 -0800
On Wednesday, January 23, 2002, at 11:53 AM, Itrat Khan wrote:
In a document-based Cocoa application, could something like
NSApplication be intercepting uncaught exceptions? I thought stuff like
this would trigger my uncaught exception handler:
[NSException raise:@"foo" format:@"bar"], or
[[NSArray array] objectAtIndex:10]
These exceptions never reach my handler, but they do log exceptions on
the console, so someone must be catching them. (I don't have any try
blocks in my code.) Uncaught exceptions usually log a message like, an
uncaught exception has occurred," but none of my forced exceptions say
that.
NSApplication catches otherwise uncaught exceptions occurring within its
main event loop, and calls its reportException: method. You can
implement this method in your NSApplication subclass to be notified when
these occur.
Douglas Davidson