Re: Problem with NSUncaughtExceptionHandler
Re: Problem with NSUncaughtExceptionHandler
- Subject: Re: Problem with NSUncaughtExceptionHandler
- From: Dustin Voss <email@hidden>
- Date: Thu, 13 Nov 2003 16:59:21 -0800
On 13 Nov, 2003, at 4:57 AM, Michael Monscheuer wrote:
I planned to catch the exeption by using my own
NSUncaughtExceptionHandler set by NSSetUncaughtExceptionHandler(). As
this special error exception is never catched by default it should be
finally sent to Uncaught Exception Handler, which then does the
complete output of all errors.
And here's the problem: With a document based application my Uncaught
Exception Handler never gets called.
NSGetUncaughtExceptionHandler() returns my function correctly, but it
never gets called though.
This does not happen within a *non* document based context. It seems
that somehow application kit always calls its own private Handler.
Any experiences according this problem?
Any idea how I can catch the uncaught exceptions or insert a method at
the end of an event loop to output the stored error path?
Yes, NSApplication installs an exception handler on the main thread.
See
file:///Developer/Documentation/Cocoa/Conceptual/Exceptions/Tasks/
ControllingAppResponse.html, "NSExceptions in an application's main
thread are caught by NSApplication's top-level handlers."
If you want to catch these exceptions, you might be able to use
NSExceptionHandler as described on that page. It doesn't explicitly say
that that works for NSApplication's last-ditch handler.
NSExceptionHandler seems entirely undocumented. I can save you the
trouble of looking in the header file, there's nothing useful in there.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.