Joy Online Manual

NAME
objc:uncaughtException - Raise an exeception that Joy does not catch

SYNOPSIS

objc:uncaughtException exception

DESCRIPTION
Joy automatically catches all NSExceptions that occur inside of Objective-C method calls or C functions and converts them to the special return code ITKOBJC_NSEXCEPTION and a result that is the NSException exception (exceptions with the name ItkObjCTclErrorException are handled specially, see below). So you can catch NSExceptions from Joy by using the catch command, and from Objective-C using NS_DURING and NS_HANDLER regardless of any intervening Joy code on the calling stack.

The command objc:uncaughtException raises an exception that Joy does not catch;  because this messes up Joy's internal data structures you should do that only in extreme cases (at top level, when your program is already in the process of terminating).

When a Joy implementation of a message that was sent from Objective-C returns an abnormal Joy return code, Joy will automatically raise a NSException with name ItkObjCTclErrorException, a reason equivalent to the result string, and a user info NSDictionary containing values for the key, @"interp", @"code", @"errorInfo", and @"errorCode". NSExceptions of this kind are treated specially by the code that translates NSExceptions into Joy return codes (see above): they are just converted back into the return code and result string  that are contained in the NSException object; also the errorInfo and errorCode variables will be set correctly. So you can catch Joy errors from Objective-C using the standard NS_DURING and NS_HANDLER mechanism, and from Joy just as if the Objective-C layer of the calling stack didn't exist.

SEE ALSO
catch

KEYWORDS
exception

Index