2020.1

Table Of Contents
If (s = "") Then
Err.Raise 449 ' Raises Error #449: "Argument is not optional" '
Err.Raise 1999,"My Plugin","Custom error" ' Raises error #1999:
"Custom error"
Else
' Do something with Job Info 9!
Watch.Log "Job Info 9's value is: " + s, 4
End If
JavaScript
JavaScript uses the throw statement to create an exception which, if not nested inside a catch
() construct, will cause the script execution to stop and the On Error tab to be triggered.
var s;
s = Watch.GetJobInfo(9);
if (!s) {
throw 449;
} else {
// Do something with Job Info 9!
Watch.Log("Job Info 9's value is: " + s,4);
}
See also: throw on developer.mozilla.org.
Python
In Python, the raise statement is similar to JavaScript and will stop processing and trigger the
On Error tab unless an except statement is used. See the python documentation.
s = Watch.GetJobInfo(9)
if not s:
raise NameError('Value cannot be empty')
else:
# Do something with Job Info 9!
Watch.Log("Job Info 9's value is: " + s,5)
Perl
In PERL, die stops execution of the script unless the unless command is used, but in order to
raise an exception and trigger the On Error tab, you must nest the die command inside an eval
statement. See the perl documentation.
Page 275