UiPath Terminal Activities connection is closed, when there is an exception due to time out issue
Issue Description
A Terminal Connection established in a workflow is closed, if the workflow encounters a time-out issue with any of the Terminal activities like Wait Screen Text.
In the example below, if the activity Wait Screen Text times out, control goes to catch block
In the catch block, the connection is not available, it is closed.
Error Message
"Terminal Error: NotConnected."
Root Cause
This is a known bug and a fix is not available even in the latest version of UiPath Terminal Activities 2.8.0. There are plans to fix this in future versions.
Resolution/Workaround
1. Surround the Wait Screen Text activity in a Try catch block
2. On Exception, if the connection is closed, Invoke Code:
conn.ConnectionChanged(ConnectionStatus.Connected, TerminalResultCode.Success)
3. Arguments for the invoke code are as below:
Note:
- The workaround will restore the connection.
- When the bug will be fixed, this workaround will have no effect at runtime.