• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Problem with NSUncaughtExceptionHandler
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
References: 
 >Problem with NSUncaughtExceptionHandler (From: Michael Monscheuer <email@hidden>)

  • Prev by Date: Re: retain and autorelease
  • Next by Date: Re: Deprecated method documentation
  • Previous by thread: Problem with NSUncaughtExceptionHandler
  • Next by thread: Modal Windows in Framework or Bundle?
  • Index(es):
    • Date
    • Thread