On Tue, Feb 2, 2010 at 3:41 PM, Oleg Krupnov <oleg.krup...@gmail.com> wrote: > Good point, Jesper. > > But in this case, how should I catch real unhandled exceptions and > send bug reports? What is the recommended best practice?
As far as I know, you really can't. The problem is that what we would generally consider to be "unhandled" exceptions actually are handled. Cocoa contains exception handlers in certain strategic places like NSTimer and NSNotificationCenter. These handlers catch the exception and log an error. You've probably seen these show up, "Exception raised during ...." These look like an error, and should be treated as errors, but they *are* being handled, just not well. Any code that only catches unhandled exceptions will miss these. Any code that catches handled exceptions will catch harmless exceptions that are being properly caught and handled by code that expects them. And as far as I know, there's no middle ground where you can only catch the "bad" ones. I think about the best you can do for these is hope the user notices that something went wrong, and have them check their Console for the message. I think that in 10.6, these messages now include stack traces, so that helps a great deal with debugging, but they have to realize that there was a problem first. Mike _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com