gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Allowing Applications to continue after exception...


From: Wolfgang Lux
Subject: Re: Allowing Applications to continue after exception...
Date: Fri, 6 Feb 2009 16:51:21 +0100

Gregory Casamento wrote:

What should "NSExceptionMask" be implemented as? SHould it be a boolean that determines if we should allow the application to continue or not?

That is to say
* NSExceptionMask = YES - report all exceptions, but continue anyway...
* NSExceptionMask = NO - current behavior

If so, I have a patch almost ready. I'll submit it to the group prior to committing it since a change that is this important needs to have some amount of consensus.

Have a look at Apple's ExceptionHandlingFramework, which is described here:

http://developer.apple.com/documentation/Cocoa/Reference/ ExceptionHandlingFramework/index.html

Implementation of this framework looks very straight forward, and I guess that they simply install the defaultExceptionHandler in the event loop of NSApplication.

The NSExceptionHandlingMask (not NSExceptionMask!) default is described in the accompanying guide that Richard mentioned already:

http://developer.apple.com/documentation/Cocoa/Conceptual/ Exceptions/Exceptions.html

In particular, see the section "Controlling a Program’s Response to Exceptions".

Essentially, NSExceptionHandlingMask is a bit mask that controls whether uncaught exceptions, uncaught system exceptions, and runtime errors are logged and/or handled. The important values (quoted from the above document) are

 #define NSLogUncaughtExceptionMask 1
 #define NSHandleUncaughtExceptionMask 2
 #define NSLogUncaughtSystemExceptionMask 4
 #define NSHandleUncaughtSystemExceptionMask 8
 #define NSLogRuntimeErrorMask 16
 #define NSLogUncaughtRuntimeErrorMask 32

Wolfgang





reply via email to

[Prev in Thread] Current Thread [Next in Thread]