Recover From Error

Verb: recover

Resumes the execution of the script on the line following the one where the error occurred, after executing the commands defined in the context of the Handle Error command.




The command is used to handle the error contained in the Open Text File for Reading command by calling a subroutine to handle this error and then resume to the next command execution.

defVar --name filePath --type String
defVar --name text --type TextFileReader
defVar --name readText --type String
onError --label errorHandling
openTextReader --share "None" --path "${filePath}" --encoding "Default" text=value
textReadLine --linenumber 1 --file ${text} readText=value
logMessage --message "${readText}" --type "Info"
// Error handling routine.
beginSub --name errorHandling
	logMessage --message "Invalid path, enter new path" --type "Info"
	openTextReader --share "None" --path recoverExample.txt --encoding "Default" text=value
// Resume execution.

Download File

For the correct operation of the script above, it is necessary to download the file and enter its path in the Path parameter of the Open Text File for Reading command.


The Recover From Error command is only used when the Handle Error command is executed using a subroutine.