Try catch blocks State Machine

Hello,

I am using a state machine and I put my process in a try catch box, assign a business rule exception called BRExpt when it fails (in catch)

however, my bot broke inside the “upload_toWeb_StateMachine.xaml”, specifically inside a retry scope and I guess the max time was reached. And I received a faulted bot and an error saying Action failed to execute as expected.

Now I am trying to put a try catch around this retry scope (inside “upload_toWeb_StateMachine.xaml”) and Assign io.BRExpt = exception.
and I wonder, when will this be passed to the level above (in picture above)? does it even work this way? What’s the best approach for this situation?

I want it to go to the catch box in the picture shown… I actually didn’t understand why the bot wasn’t sent there the first place when error occured in the “upload_toWeb_StateMachine.xaml” but the bot was faulted

Thanks

Hi,

I realized when I used BusinessRuleException, it wouldn’t go to the Catch box at all. When I use System.Exception, it goes to the Catch box.

So I have two workflow, the top level has a try catch,

Workflow_A:

Try A:
Assign a_except = nothing

In Workflow_B
Try B:
Click something that is not there
Catch B:
image

Catch A:
Assign a_except = exception

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
It is not going go to Catch A when error occurred in Try B