OnError

OnError installs a script executed when a command fails. The script is loaded at the moment KCM Core is started. If an error occurs, the current script terminates and KCM Core transfers control to the script OnError. KCM Core stores error information for up to ten error occurrences in a folder CompositionErrors in the Document Processor subfolder of the Temp folder. After ten occurrences, the previous information is overwritten again starting with the oldest error information.

If an error occurs and no error handler has been installed, the script terminates and a run-time error is reported.

There are two special script names:

  • Script(*) forces KCM Core to ignore any errors and to continue.
  • Script(-) forces KCM Core to cancel any previous OnError commands in the script and to terminate normally if an error occurs, as if no error handler has been installed.

Syntax

OnError
Script(…)
<Key>(…)
<Key>(…)… ;

Parameters

  • Script: Required. The name of the script called whenever an error occurs.
  • <Key>: Optional. Zero, one or more parameters passed to the script. The type of these keys is determined by the type of the parameters needed in the script called with the parameter Script(…).