|It provides a way to perform actions when a not managed exception occurs at runtime.
Is the name of a subroutine contained in the program which makes use of this rule.
The exception_handler rule is declarative.
Defining this rule (and its associated subroutine) does not affect its flow, output or exit code. It just allows using the moment after an exception happens, for some useful action like notification of someone, so that monitors can take action on the happened exception.
The performed action should be a safe one, not one that could also fail.
It is possible to get more detailed information about the exception, defining the following variables and using them in the subroutine.
||Name of the platform-specific type of exception
||Message, reason, or detailed information associated with the exception
||Runtime stack trace information about the exception location
- If an object A calls object B, both have an Exception_Handler defined, and an exception occurs in B, then the subroutines of both objects are executed
- If an object A calls object B, A has an Exception_Handler defined, and an exception occurs in B, then the subroutines of A is executed
NotifyException(&GXExceptionType, &GXExceptionDetails, &GXExceptionStack) //sends a notification of some kind to sysadmin
Languages: .Net, Java,
Exception_Handler Rule is available since GeneXus 16 upgrade 7.