ETException documentation

Authors

Generated by builder

Contents -

  1. Software documentation for the NSException(ETException) category
  2. ETException types
  3. ETException macros
  4. ETException variables
  5. ETException functions

Software documentation for the NSException(ETException) category

NSException(ETException)

Declared in:
ETException.h

@group Language Extensions

Method summary

enableEtoileExceptions 

+ (void) enableEtoileExceptions;

Enable resumable and restartable exception handling. This only needs to be called once; subsequent calls will have no effect. If it is not called, then [NSException raise] will have the default behaviour.

Note: The OS X implementation of NSException does not conform to the documented behaviour. Resumable and restartable exceptions are not supported when using Apple's Foundation framework, unless exceptions are raised by creating an NSException object and then sending it a -raise message.


popHandlerForException: 

+ (void) popHandlerForException: (NSString*)aName;

Removes the top exception handler from the stack corresponding to the name.


pushHandler: forException: 

+ (void) pushHandler: (ETHandler)aHandler forException: (NSString*)aName;

Adds aHandler to the top of the exception handling stack for exceptions named aName. Any exceptions called with the specified name will cause this handler to be invoked while it is on top of the exception handling stack.


ETException types

ETExceptionType

typedef enum ... ETExceptionType;

Type of exception. Used as the return type from exception handlers. Abort causes stack unwinding. Resume continues execution after the line that raised the exception and retry causes the block that caused the exception to be retried, if it was declared as restartable.


ETHandler

typedef ETExceptionType(* ETHandler;

Prototype for exception handler function.


ETException macros

NS_RESTARTABLE_DURING

NS_RESTARTABLE_DURING

Version of NS_DURING which permits restarts to occur if restartable exception is issued. In the event of a restartable exception being raised, control will jump to the start of this block. Care must be taken to avoid infinite loops and memory leaks.


NS_RESTARTABLE_HANDLER

NS_RESTARTABLE_HANDLER

End a restartable exception block. Equivalent to NS_HANDLER to be used with NS_RESTARTABLE_DURING.


SET_HANDLER

SET_HANDLER(exception, handler)

Adds the specified handler for the named exception for the duraction of the current lexical scope.


ETException variables

GLOBAL_EXCEPTION_STATE

ETExceptionType GLOBAL_EXCEPTION_STATE;
Description forthcoming.

ETException functions

pophandler

void pophandler(void* exception);

Function installed as a cleanup function by SET_HANDLER to pop the added exception off the stack when the current lexical scope is exited.