Help with error handling

Discuss RoboTask here
Post Reply
holysmokes
Posts: 1
Joined: Tue Apr 17, 2018 2:23 pm

Help with error handling

Post by holysmokes »

Hello,

I am putting together a task, and having some trouble as im not too familiar with the software.

I included the log below, basically what happens is that the part before the error "wait for window", its attempting to connect to a VNC server, and next step would be to enter password. What I want to do is add an IF statement saying if this errors happens then run this task. I tried to add the error handling task to the advanced tab but it basically run on any error thrown, and I only want it to run on this error.

I: 4/17/2018 6:23:54 AM: Executing "18.Run "VNC-Viewer-6.1.0-Windows-64bit.exe ""
I: 4/17/2018 6:23:54 AM: Executing "19.Wait For Window"
I: 4/17/2018 6:23:54 AM: Executing "20.Move To An Object"
I: 4/17/2018 6:23:54 AM: Executing "21.Double click left button"
I: 4/17/2018 6:23:54 AM: Executing "22.Wait For Window"
E: 4/17/2018 6:24:09 AM: Timeout is over
E: 4/17/2018 6:24:09 AM: An error occurred. Step #22 (Wait For Window).
E: 4/17/2018 6:24:09 AM: Task execution is aborted
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Help with error handling

Post by Oleg »

You can use IsError variable after Wait for Window step to detect the error.
Read here please: https://robotask.com/help/index.php?err ... essing.htm
If there is an error occurs in any step during a task, RoboTask records an error message to the task log and stops the task by default. You can change this behavior. To do it, you should select the "Advanced" tab in the task editor and set the "If Error Occurred" parameter to "Continue Execution". In this case, the task will not be stopped in case of an error.

The system variable {IsError} is used to analyze if there was an error in the previous step. This variable contains "True" if there was an error in the previous step and "False" if there was no error in the previous step.
Image
Oleg Yershov
Post Reply