Want to retry both Try and Catch block when exception occurs

I have a workflow where I’ve used a Try block for functionality and a Catch block for relaunching the application. The entire Try Catch structure is within a Retry Scope activity. However, when an exception occurs, the Retry Scope retries the Try block. Instead, I want the Catch block to run every time an exception occurs.

I have attempted using a Do While loop, but it still doesn’t direct to the Catch block if I use the loop.

@Surendra_Kumar_Bonu

Use a retry scope and use validate and assign a boolean variable

Now try catch should be inside retry…in try as last step set boolean to true and in catch block set it to false

So when there is exception and once the app is relaunched in catch it eould retry…if everything is successful it would move ahead

Cheers

Thank you for your reply,

When exception occurs its not coming to catch block retrying try block only

1 Like

Hi @Surendra_Kumar_Bonu ,

As a quick solution, you can try as below:-

In a catch, copy try code. So when exception occurs, it will again execute Try Catch code in catch section.

Thanks,
Jayesh

@Jayesh_678 Thank you for your response. While it will work, shouldn’t we consider incorporating retries into the approach?

@Surendra_Kumar_Bonu

Did you keep whole of try catch inside retry only?

Cheers

Yes @Anil_G kept entire try catch in retry scope

@Surendra_Kumar_Bonu

then when error occurs catch would catch and then it would retry from try

cheers