How to repeat try things in catch?

If I have some lines in try and it gets an exception. Is there any way so that I repeat that line again in catch without having duplicate code writing in the catch block.

Can we make some functions like that also?

Hi @blacksundar,
You can use nested Try Catch activity or Retry Scope.

1 Like

Just to make sure I understand your question you have something like this? In your Try block you have some code, let us assume you want to assign a value to a variable. For whatever reason you get an exception which you catch in your Catch block. In that catch block you want to assign the same value to the same variable? Can you explain why you want to do this. If this is the case what you could to is put your Try catch block in a while loop. While you have a exception keep repeating the Try Catch block. Of course you don’t want to get stuck in an endless loop. So maybe you should consider also built in a counter for max exceptions.