The StartCatchingErrors Method

Previous Next

See Also

The internal Rules Engine StartCatchingErrors method instructs the Rules Engine to begin catching error messages and continue until the StopCatchingErrors method is called. You can then check if any errors, or even if a specific error has occurred. These error messages can be stored in the database or saved to a file, if required. The catching of error messages in this manner does not influence program flow in any way.

You can nest multiple calls to the RulesEngine.StartCatchingErrors method. This makes it possible to catch error messages without needing to know if the caller is already catching error messages.

The syntax with the allowed parameter values is:

SELECT RulesEngine.StartCatchingErrors('Yes'|'No')

The optional input parameter is filter=Yes or No (default = Yes). When set to 'Yes', errors will no longer be handled by the original handlers, that is, they will not be displayed on the screen, or written to a log file, etc. If you want to catch the errors AND let the original handlers handle them, then set filter to 'No'

There is one return parameter: a number indicating the nesting depth of the error catching. The first call to the method will return 1, a second call, without the first session being stopped, returns 2, etc.