(Let me know if I'm categorizing this wrong or anything. Despite using KM since version 3 this is my first time joining the forum.)
I am very happy to see the new try/catch action as I have some very complex macros that will sometimes fail for random reasons. Some of these take 40 min or more to run, so not having to re-run them and watch like a hawk when troubleshooting is great.
My problem/request is for a way to quickly locate a failing action. Actions are often nested deeply within macros, and actions, unless renamed individually, are generally indistinguishable from every other instance of the same action type. To help myself out, most groups within my macros are custom labeled so I can find a failure point quickly using the debug window, if I am watching it.
What would be really helpful is to capture the true "path" of the failing action as a token, in addition to its name and output result.
In trying to do this on my own, I have tried to screen capture and OCR the debugger window, store it to a clipboard and email it to myself, but it fails to capture anything intelligible. I suspect it vanishes too quickly to capture properly.
I am currently using the following tokens. If anyone can think of other relevant tokens please let me know.
%ExecutingMacroGroup%
Works as expected, since the macros are grouped logically.
%ExecutingMacro%
The way this works makes logical sense, but is less helpful to me. I am running many macros in sequence with "execute macro" actions, and currently the executing "sub" macro is not named, rather the "orchestrating" macro is. Effectively this duplicates %ExecutingMacroGroup% in my case.
%ExecutingThisMacro%
This does go one layer deeper into the onion, which is a helpful start.
%ActionResult%
This correctly names the action that failed, and its result, but lacks enough context to directly locate it.
%Application%1%
%WindowName%1%
The combination of these gives me enough clues to figure out which part of the macro to start looking in.
Here's an example of a failure notification email I set up with tokens:
Subject:
Error %ExecutingMacroGroup%
Body:
%ExecutingThisMacro% macro failed with message: %ActionResult%
Current Application %Application%1%, window %WindowName%1%
TL:DR
In a nutshell, if the output of the debugger at the moment of failure could be captured as a token I could email it to myself and quickly locate the path of a nested failing action.
Here's an example of the nested debugger output for those who haven't seen it recently.
“Orchestrating Macro Name”
Try Executing Actions and Execute Catch Actions on Error
Execute Macro “Name of sub-macro”
“Group name”
if All Conditions Met Execute Actions
“Sub-group name”
Pause Until Conditions are Met
Since this is my first post, I will say I really appreciate KM and I have alway found it to be a fantastic tool. Try/Catch is already significant improvement for me, and I hope the feedback is helpful.