Retry scope log and notify the failures

I have a macro that deals with a website that sometimes does not load correctly. I believe I’ve solved this issue by using a retry scope. What I’m looking to add is to notify me of the failure. I’d like to know if this is occasionally failing retrying and recovering, or if it’s happening many times. I’d like to send a notification email to me so I know it failed even though it retried and ultimately worked. I know how to send notifications, but where would I insert my email notification code? Ultimately I’d probably count the errors to a variable and send in the end of job notification email. Either way where can I insert some logic for the fail occurrence of a retry scope. I am still rather new to this tool, so forgive me if I’ve missed something obvious.

Thanks!

Add try catch activity inside the retry scope. Then put your email notification code snippet to the catch block.

Hi Emman,

Wouldn’t the catch cover up the error preventing the retry scope to trigger the retry?

Thanks

I think you can rethrow the exception after the notification code snippet.

Makes sense, then I can log the exception as well. I’ll give it a try. Thanks!

1 Like