defaultHandler

defaultHandler(): Integer;

The defaultHandler method of the Exception class is the "handler of the last resort" that is automatically invoked on the exception instance if no other exception handler consumes the exception. The exception, including the method call stack history and the exception stack history, is written to the log file of the current application (for example, MyApp.log).

In client-side GUI applications, the defaultHandler method calls the Exception class showDialog method on self.

If the showDialog method returns true, the defaultHandler method ignores the exception by returning the result of Ex_Continue. (Note that it is not valid to ignore non-continuable exceptions.) However, if the showDialog method returns false, the defaultHandler method first aborts any current persistent or transient transaction and then terminates the current action by returning an Ex_Abort_Action result.

When the defaultHandler method is invoked for an exception raised in non-GUI-capable methods (including server methods, server application methods, and any non-GUI application methods), the defaultHandler method does not call the showDialog method but instead aborts any current persistent or transient transaction, logs the exception to the exception log file of the current application, and when invoked from a server method it returns Ex_Pass_Back; otherwise, it returns Ex_Abort_Action.

You can reimplement this method in your subclasses of the Exception class, if you want different default behavior. Your exception handlers that do not handle a specific exception should return Ex_Pass_Back rather than directly calling the defaultHandler method.

For details about the default exception handler and the values that are returned by JADE, see "Handling Exceptions" and "Creating an Exception Handler", respectively, in Chapter 3 of the JADE Developer’s Reference.