How to use Try Catch Activity with Matches activity

Hi. I am using Matches activity like that

-Read my mail with For Each
-Filter by matches activity
-If there is no problem with filtering, continue processing

And I want to add this

If you get error in read mail or matches activities, send me mail

How can I add this ?

@sufyant

You can add a try catch block around the matches activity. The Send Mail activities can be added in that Catch block, so as to recieve E-Mails in case of errors.

1 Like

Hi @sufyant,

You can place the Read mail activity in a TryCatch, then add a catch with in there a send mail activity.
The same goes for the matches activity.

Hope it helps,

Astin

2 Likes

@Astin @SowmyaLeo which exception do I need to choose?

@sufyant

System.Exception

1 Like

@sufyant

You can use System.Exception for this.

2 Likes

@Astin @SowmyaLeo Thank you. will notify me if it gets an error in a mail. but I want to continue reading other mails and continue process for not errored mail, how do I do it?

@sufyant

The for each loop will continue as normal . There is nothing extra that needs to be done.

1 Like

@sufyant

After the exception your workflow continues running like normal and will read another email.

2 Likes

But dont working. does not give an error and does not send mail @Astin @SowmyaLeo

@sufyant

Can you try running it in debug mode and see what happens.

1 Like

I tried but there is no error. robot is quit the matches activities and closes project

@sufyant

Please post a screenshot of the workflow if possible.

@sufyant

I can’t see the Matches activity here.
The sequence above is looping through the E-mails and if the subject of the email contains the word “Lead” it follows what is in the flowchart else does nothing.

If the error from the Matches activity needs to be captured, please add the try catch around the Matches activity (Presume it is within the Flowchart).

1 Like

like that ?

@sufyant

Yes

1 Like

but dont working

@sufyant

When debugging, Does the code reach the Matches activity?

Is there an error when the Matches activity is executed?

1 Like

No there is no error