• 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
Leopard exception handling driving me crazy!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Leopard exception handling driving me crazy!


  • Subject: Leopard exception handling driving me crazy!
  • From: Gerd Knops <email@hidden>
  • Date: Fri, 12 Sep 2008 12:34:17 -0500

OK, so:

	[[NSExceptionHandler defaultExceptionHandler]setDelegate:self];
	[[NSExceptionHandler defaultExceptionHandler]setExceptionHandlingMask:
		0
		| NSHandleUncaughtExceptionMask
		| NSHandleUncaughtSystemExceptionMask
		| NSHandleUncaughtRuntimeErrorMask
		// | NSHandleTopLevelExceptionMask
	];

If I include "NSHandleTopLevelExceptionMask", my nested exception handlers do NOT get called and it jumps right to the delegates '- exceptionHandler:shouldHandleException:mask:' method (mask being 128, NSHandleTopLevelExceptionMask). It catches the exception deep down in the code, even though there are 2 levels of handlers around it.

If I don't include NSHandleTopLevelExceptionMask, the nested handlers get executed (they are throwing other exceptions containing more information and referencing the original exception), but the exception finally reaching the delegate is not the exception thrown at my top- level handler (and it definitely is being thrown), but rather this less than useful:

	Uncaught system exception: signal 5

with no apparent access to that last exception my code actually generated. The mask reported is 8, NSHandleUncaughtSystemExceptionMask.


Now what I was expecting is that with NSHandleTopLevelExceptionMask included, the handler would only receive exceptions escaping my top level exception handler, rather than the 'original' exception deep down in the code.


Where am I going wrong?

Thanks

Gerd


_______________________________________________

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


  • Prev by Date: Re: Two Dimensional Array
  • Next by Date: Re: Animate a CGPath
  • Previous by thread: NSArrayController's canRemove controllerkey and toolbar items problem
  • Next by thread: Programmatically dismiss NSPopUpButton menu
  • Index(es):
    • Date
    • Thread