Try catch is not catching the error

Good afternoon;

A consultation friends please, I want to do the following:

When there is an error in any activity within “sequence 2” , “try catch” prevents the robot from stopping and continuing with other activities out of sequence 2.

For example, if something fails in the body of the for each, I would like try catch to send an error message and then continue with the next element of the for each

I tried but the robot always stops and never enters the “Catches” area to send a message.

How could I solve this case?

hey

you have to add the catch field

example:
image

regards!

The image is an example, if I set that block to system.Exception.

When I use try catch in a single activity it works, but when I use it by grouping several activities inside other sequences, it doesn’t work even if I enclose the whole main sequence with try catch

the try catch activity will cath the first exception that will appear inside the try block, no matter how much secuences you have, if the first secuence throw and error, the rest will not execute and will go to the catch block, if you need to catch 2 secuence then you need to use 2 differents try catch

Regards

2 Likes

Also it’s best practice to use the Try Catch on the lowest activity, so if any errors occurs you can catch it and execute the logic flow. This way for each activity in the try-catch block, you will catch the errors

1 Like

Apparently it was because it was running in debug, so the bot stopped. I tried with run and if the try catch works for me :sweat_smile:

imagen

2 Likes

You are very right, but for this case I do have to stop the entire body part and continue with the other “for” elements. Now I am going to see how to identify exactly the location of the error.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.