Cancelling browser operation throws an error

browser
studio
p_solved

#1

Hi,

If a browser operation (f.e. attach) is being cancelled, it throws following error:

PickTest has thrown an exception Message: The activity 'Launch Workflow Interactive' with ID 7 threw or propagated an exception while being canceled. Exception Type: InvalidOperationException System.InvalidOperationException: The activity 'Launch Workflow Interactive' with ID 7 threw or propagated an exception while being canceled. ---> System.InvalidOperationException: The activity 'Attach Browser 'iexplore.exe Google'' with ID 3 threw or propagated an exception while being canceled. ---> UiPath.Core.BrowserOperationException: Operation was canceled. ---> System.Runtime.InteropServices.COMException: Operation was canceled. at UiPath.UiBrowserClass.Find(String bstrSelector) at UiPath.Core.Browser.Find(Selector selector) --- End of inner exception stack trace --- at UiPath.Core.Activities.ScopeActivity.EndExecute(NativeActivityContext context, IAsyncResult result) at UiPath.Core.Activities.AsyncNativeActivity.BookmarkResumptionCallback(NativeActivityContext context, Bookmark bookmark, Object value) at System.Activities.Runtime.BookmarkCallbackWrapper.Invoke(NativeActivityContext context, Bookmark bookmark, Object value) at System.Activities.Runtime.BookmarkWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager) --- End of inner exception stack trace --- at UiPath.Core.Activities.InvokeWorkflowFile.EndExecute(AsyncCodeActivityContext context, IAsyncResult result) at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result) at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager) --- End of inner exception stack trace ---

This is not consistent with AttachWindow, TypeInto or other activities that can be cancelled normally.

Edit: Since an error thrown during cancellation is equivalent to throwing from Catch block or using TerminateWorkflow it bypasses immediate level TryCatch making it very awkward to design around.

Regards.


#2

hi andrzej.kniola

i have tried to reproduce the problem, but i`m having trouble canceling the workflow right after run. the attach activity happens instantly and there is no time to stop it from studio
how do you reproduce this, can you give us more details?

thank you very much.


#3

Hi Gabriel,

Please find attached a repro example - it’s a parallel setup with a failing Attach in one branch and delay (essentially a timeout equivalent) in the second branch.

PickTest.xaml (7.3 KB)

Regards.


#4

will have a go and get back to you.


#5

@Gabriel_Tatu
Was this ever fully diagnosed? We’ve had this (or very similar) situation in one of the robots yesterday evening.


#6

Hi Guys, do you know how fix handle that error? I have one similar and I don`t know how to handle …

System.InvalidOperationException: The activity ‘WaitImageAppear’ with ID 36 threw or propagated an exception while being canceled. —> UiPath.Core.Activities.ActivityTimeoutException: Activity timeout exceeded
at UiPath.Core.Activities.WaitImageAppear.EndExecute(NativeActivityContext context, IAsyncResult result)
at UiPath.Core.Activities.AsyncNativeActivity`1.BookmarkResumptionCallback(NativeActivityContext context, Bookmark bookmark, Object value)
at System.Activities.Runtime.BookmarkCallbackWrapper.Invoke(NativeActivityContext context, Bookmark bookmark, Object value)
at System.Activities.Runtime.BookmarkWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
— End of inner exception stack trace —
at UiPath.Core.Activities.InvokeWorkflowFile.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)


#7

Hi Carmen,

What Studio version do you have? This was fixed in the last version 2017.1.6522.


#8

image Yes I’m working in the last one. But I was reading how to handle exceptions and I found that is better using invoke workflow file and sorrounded by a try catch and I did and works ok.


#9

Hi,

I received also “threw or propagated an exception while being canceled” kind of error message and problem was that it was not caught by Try-catch in same workflow. Try-catch at higher level workflow caught it.

What is causing this kind of problem and how to catch those exceptions?