Exception Class

The Exception class defines the protocol for raising and responding to exception conditions. The specific kinds of exceptions that can occur are defined by the subclasses of exception, as follows.

Some of the exception numbers defined in the jomerrs.h file are negative; for example:

#define NET_NOPEN  -102 /*Network connection not open*/

Negative exception numbers are considered fatal. When an external method returns a value less than zero (0), the object manager will terminate the node rather than raise an exception.

The exception numbers for an out‑of‑memory error are:

#define FATAL_OUT_OF_MEMORY -100 /*A memory allocation request failed*/
#define OUT_OF_MEMORY 1448 /*A memory allocation request failed*/

Consider carefully what you want to happen if a memory allocation fails. Many out‑of‑memory conditions are recoverable.

In Jade thin client mode, exception dialogs are always displayed on the presentation client. The following is an example of the definition of an exception handler method.

handleException(exObj: Exception): Integer;
constants
    StringTooLong = 1035;
begin
    if exObj.errorCode = StringTooLong then
        app.msgBox("The picture is too large:", "Error", 0);
        return Ex_Abort_Action;
    else
        return Ex_Pass_Back;    // default dialog
    endif;
end;

For details about the returned values from exceptions and the properties and methods defined in the Exception class, see "Exception Class Return Values", "Exception Properties", and "Exception Methods", in the following subsections. For a list of the global constants that you can use in your exception handlers, if required, see the JadeErrorCodesDatabase, JadeErrorCodesSDS, and JadeErrorCodesWebService global constants categories in Appendix A of the Encyclopaedia of Primitive Types.

Object

FatalError, NormalException