The error environment variable

IBM Robotic Process Automation has special variables that hold information about the bot's runtime called environment variables. One of these variables is the error variable.

The error environment variable is a special variable that holds data about Runtime Exception events. This variable is null until an exception happens.

Like all environment variables, the error variable is available to all scripts. Its type is Error, and you can reference it as ${wdg:error}.

Note: To list all environment variables available, click the Toggles environment variables visibility icon The environment variables visibility icon in the Variables window, or the Select a variable helper window. You can enter Ctrl+E when on the Select a variable helper window to toggle environment variables visibility.

The error variable has the following parameters:

Message
Holds the exception message.

LineNumber
Holds the line number where the exception event took place.

Command
Holds the command name that raised the exception.

Script
Holds the script name that raised the exception.

Routine
Holds the subroutine name where the exception took place.

StackTrace
Holds the call stack trace of the exception. The call stack trace is the hierarchy of subroutines and script calls until the command that raised the exception.

Count
Holds the number of elements in StackTrace.

Note: If you use ${wdg:error}, it compiles all parameters' data as a text message.

Parent topic:

Related topics: