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 protected])

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 [EMAIL PROTECTED]

Reply via email to