Hello, We are working on building code/framework that can be used to automatically retry on failure and suspend trigger in case on permanent failures. Can anyboby suggest few logic which they have been already implementing in their projects.
The meanings of “transient error” and “permanent error” are entirely up to you. In your code you need to examine the specific error code and/or message and decide whether or not to throw an error for retry or a service error.
To suspend a trigger, simply configure the trigger to suspend when an error is thrown.
Be careful about using PSUtilities services without fully understanding what they do.
I have a requirement where I have to create a log file when the trigger service is retrying on transient error. I have set the retry property in the trigger property panel. The log file needs to log the message each time the service is retrying. After the max retry count is reached and the trigger gets disabled I need to log that message that the trigger got disabled as well. Finally when the resource monitoring service gets called to check when the resource is available I need to log the message that the trigger along with the trigger name got enabled. Can someone help me with this? Is there a way to get the trigger name which is calling the resource monitoring service?