Hi - I have a scenario where I need to loop through list of codes and download report , if download fails I capture that exception and send email at the end , but I still have to try other codes even if one fails , how to do it in without using Queue. any advise ?
Inside For Each:
- Try
– steps for downloading report - Catch
– Send email
If one report download fails, it’ll jump to the Catch block. That’s where you send your email. Then the For Each continues to the next item.
Hello @monishanair2010
You can use Try catch block in the download report step . Whenever if the download fails with an exception, it will get capture in the exception block and you can write the details to a log file or to excel sheet to send email at the end.
So the loop will not break.
Thanks
Hello, what I can see, if an exception is thrown:
The exception might not be properly catched and is promted to the user.
Or if you get an exception, you can see the reason for that exception.
Better use the “Finally” clause of a “Try Catch” statement.
And add there a condition for the cause that might raise the exception.
For inst., check if a String length is 0, or equals to “”, or is null.
Actually some expressions do not raise an expression if string is null.
I created a Data Table variable, and used the Build Data Table Action.
Let’s say we name this ResList and it is of type System.Data.DataTable
End everytime this condition is encountered, add a new Data Row to it.
Set a variable with the name, or the key that verified that condition.
And add it to a data row as a list, using the AddDataRow action.
The data row being added might look like this: { name , “” }
Then you can use this DataTable when sending the email report.
I don’t know how that emeil works, you know better what method to use.
With kind regards, Adrian Brinas. Hope it helps.
Simply do Surround with Try Catch to For Each Body
in the catch block …Setup mailpart
Thank you, It worked.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.