OnError / End OnError

Takes one parameter, Control

Description:

The command controls the runtime behaviour when an error occurs. The one Control parameter may be one of the following options:

Details:

The default behaviour when OnError is not used, as well as the behaviour after End OnError, is that all runtime errors halt the process and show the user a generic runtime error message if not a DB Admin, or a message with more detailed error information if the user is a DB Admin. Runtime errors are also recorded in the Moxie.log file, and if configured with the Setup table record Cnw.EmailErrTo value, detailed error information plus a query memory dump will be emailed.

The scope of OnError / End OnError is contained within Private Methods and Private Functions.

Note that command which track errors on a per-Work Query record basis, such as all Database commands (e.g. New, Updated, Delete, Attach, Detach, etc...) will not trigger a runtime error for any errors that occur on individual Records. These many be tested and/or filtered for manually, or use the FailIfRecError command to cause a hard runtime error if any Records have an error, or use [AnyRecError] to test if one or more Records have an error.

See also:

Examples:

OnError "Sorry, we ran into an unexpected error while updating your profile"

OnError MethodName.HandleErr:

OneError Continue
'Try something
End OnError