
Hi all, I'm new to PAD. For error handling, I have read this: https://powerusers.microsoft.com/t5/Power-Automate-Desktop/Error-Handling-Desktop-application-Error-Message-Dialog-Box/m-p/955799
After some try, I haven't get the best way to handle error.
1. Central Error Handler Flow?
I'm a VBA old dog. In VBA I use a Central Error Handler function from Professional Excel Development for log error, display error message, raise/re-throw error and so on.
I try to create a Central Error Handler Flow, but:
1) PAD flow call another flow is slow;
2) Error object can't be pass as a input/output variable;
3) there no global variable can setup DEBUG/RUNTIME mode .
Another idea is using sub-flow, but:
1) Must copy code to very flow's error handler sub-flow, if code changed, I must do it again for every flow;
2) If call a flow from another flow, witch error handler sub-flow should be use? How to know the error has being handled or should be raise again?
2. Where or when to display Error Message?
I have try use a [Display message] action to display error message, but the message will stop the all flow running. It like a Break but not a MsgBox in VBA. Yes, in edit mode, all error will display at the window bottom. I think it like a debug mode not for runtime. In runtime what's the best way to display error message? Or it's all should not be displayed?
Thanks!
In regards to the last point, I’m not at my computer, but I believe there is a “Get Last Error” action, so what we have been doing is an ‘On Error Block’ surrounding the entire Main flow that runs an Err_Subflow that just says, ‘Write %Lasterror% to text file.’