I have a sequence of processes and I want to put a try-catch block in the loop that should catch the error in this statemenet and if the error exists, it should send a mail and then continue to next iteration, otherwise if there’s no error, it should go as it is naturally:
In the above image I want to put try catch block, but the two problems I am facing is:
Not able to add continue block or code snippet.
In the try catch activity zone, I am able to add only one activity, but in catch I want to perform two of them: 1. to send the mail with error alert and 2. to continue the loop with next iteration.
You can add more than one activity in the Catch part of a TryCatch with a sequence. If the TryCatch is round the loop activity, you shouldn’t need a continue.
It depends on your email domain, normally I would use send SMTP mail message. You’ll need email credentials, the email server, and port for sending. This is the Gmail smtp server info:
yeah! I mean I want a string variable that contains the entire error message and I will parse it to SMTP body. Any tips for that? Like for example:
ASSIGN
errorMessage = “”
where ERRORMESSAGECODE is a snippet or something that returns a string of the error that was catched in try-catch.
Ah right, that would be variable exception I believe. Specify it in the email body and set the subject to “Process Name - exception” or something similar