Siebel Analytics Scheduler Guide > Configuring Siebel Analytics Scheduler Job Scripts > Analytics Scheduler Script Object Methods and Events >

OnError Event


Occurs when the script engine encounters a run-time error while executing the script. This is intended for cleanup purposes, but the creative use of try/catch blocks in JScript and proper Error Handling in VBScript are often superior alternatives to using this event.

Syntax

OnError

Usage

The script engine calls this procedure when it encounters a run-time error while executing the script. Define this procedure in your script if you want to perform some cleanup activities before the script terminates, such as deleting temporary files and releasing resources.

Examples

Example in VBScript:

Public Sub OnError()
   LogFile.WriteLine "Encountered a runtime error in the script."
LogFile.Close
End Sub

Example in JScript:

function OnError()
{
   LogFile.WriteLine("Encountered a runtime error in the
   script.");
LogFile.Close();
}

Siebel Analytics Scheduler Guide