Raise an error manually
-
- Posts: 6
- Joined: Wed Jan 23, 2013 3:01 pm
- Location: United States
Raise an error manually
If there are certain conditions in my task, I would like to manually raise an actual error that would stop the script or run a error handler and pass the error variables to it.It would be nice if I wrote an ERROR type message to the log with Log Message that an error would be raised and the task proceed as it would in the case of any other error in a task.Is this clear?Thanks.
Raise an error manually
You always can start handler task with parameters:
LastErrorTaskID={TaskID}
LastErrorTaskName={TaskName}
LastErrorTaskExternalName={TaskExtName}
LastErrorStep=<Write something>
LastErrorCode=<Write something>
LastErrorDescription=<Write something>
put into your task such code:
if some_condition then
Start task (handler task with parameters)
Stop task (this task)
end if
LastErrorTaskID={TaskID}
LastErrorTaskName={TaskName}
LastErrorTaskExternalName={TaskExtName}
LastErrorStep=<Write something>
LastErrorCode=<Write something>
LastErrorDescription=<Write something>
put into your task such code:
if some_condition then
Start task (handler task with parameters)
Stop task (this task)
end if
-
- Posts: 6
- Joined: Wed Jan 23, 2013 3:01 pm
- Location: United States
Raise an error manually
Ok. I did do something kind of like that but used different variables. I didn't know if the LastError... variables were writable.Thanks for tip, Oleg.
Raise an error manually
LastErrorTaskID, LastErrorTaskName, LastErrorTaskExternalName, LastErrorStep, LastErrorCode, LastErrorDescription are parameters of error handling task.
Read more here.
RoboTask passes these parameters automatically on error.
Of course you can start error handling task with the same parameters or with your own parameters.
Error handling task is the same as other tasks.
Read more here.
RoboTask passes these parameters automatically on error.
Of course you can start error handling task with the same parameters or with your own parameters.
Error handling task is the same as other tasks.