Using the on error Command

Related Topics

Use this command and its parameters to dictate the script behavior when execution fails. The default behavior is for the script to continue executing subsequent commands after a command has failed. The other parameter you can use is stop, so the script engine stops after a failed command.

Important: This command is for execution errors, not syntax errors. Also, there may be certain error conditions that override the on error continue parameter.

If you want to...

Use this command and parameters

stop execution of the script (do not execute subsequent commands) if any commands following the on error stop command fail

Back to the top

Base Command and Required Parameters

on error stop;

Example

Command statement:

on error stop;

recreateFlashCopy logicalDrive ["Chevelle-S1"];

download storagesubsystem firmwareFile="04000001.dlp";

Execution result:

If the recreateFlashCopy command fails, the script engine does not attempt to execute the download storagesubsystem firmwareFile command that follows.

continue execution of subsequent commands if any commands following the on error continue command fail

Note: This is the default script engine behavior.

Back to the top

Base Command and Required Parameters

on error continue;

Example

Command statement:

on error continue;

recreateFlashCopy logicalDrive ["Chevelle-S1"];

download storagesubsystem firmwareFile="04000001.dlp";

Execution result:

If the recreateFlashCopy command fails, the script engine attempts to execute the download storagesubsystem firmwareFile command that follows.

Related Topics

Learn About the Script Editor

Using the Script Editor

Command Reference