Using Exception Handlers in Non-Jade Applications

You can define and arm exception handlers in non‑Jade applications (that is, in applications such as C++ that interface to the Jade Object Manager Application Programming Interface).

Non‑Jade applications should arm an exception handler by calling the Jade Object Manager API jomArmExceptionHandler entry point. For details about the parameters to this call, see "Arming an Exception Handler", in Chapter 3 of the Object Manager Guide.

As the default exception handler is not invoked if you intercept an exception with your own handler, the Unhandled Exception dialog is not displayed, regardless of the value returned for your exception handler.

If you want to invoke the default handler and therefore display the Unhandled Exception dialog and write the exception to the application log file, you must send the message "defaultHandler" to the exception object.

An exception handler in a non‑Jade application can return any of the return values listed in the table under "Creating an Exception Handler", earlier in this chapter. The effects are similar, but are restated in the following table to clarify their effect in this context.

The following table lists the C++ defines that are provided in the jomdefs.h file.

Return Value Define Action
0 E_CONTINUE Processing continues as if no error had occurred. The Jade Object Manager Application Programming Interface (API) call that caused the exception ultimately returns a zero result to the user application.
1 E_ABORT_ACTION Aborts the current action. The Jade Object Manager message stack is cut back, and control returns to the user application, with the Jade Object Manager API call that caused the exception returning a zero result.
2 E_RESUME_NEXT

Passes control back to the method that armed the exception handler. If the exception handler was armed in an external method, the Jade Object Manager message stack is cut back to this method and the Jade Object Manager API call that caused the exception returns a zero result.

If there were no Jade Object Manager messages on the stack when the handler was armed, the effect of the E_RESUME_NEXT define is identical to that of the E_ABORT_ACTION call.

You cannot resume from global exception handlers. Using this value for a global exception handler is equivalent to returning the E_Abort_Action value.

3 E_RESUME_METHOD_EPILOG

Passes control back to the method that armed the exception handler. If the exception handler was armed in an external method, the Jade Object Manager message stack is cut back to the method that called this method and the Jade Object Manager jomSendMsg API returns a zero result.

If there were no Jade Object Manager messages on the stack when the handler was armed, the effect of the E_RESUME_METHOD_EPILOG define is identical to that of the E_ABORT_ACTION call.

You cannot resume from global exception handlers. Using this value for a global exception handler is equivalent to returning the E_Abort_Action value.

-1 E_PASS_BACK Passes control back to any previously armed exception handler for this type of exception. If there are no other applicable handlers, the Jade Object Manager message stack is cut back and control returns to the user application, with the Jade Object Manager API call that caused the exception returning a non-zero result representing the error condition.