Bug Report: KM Engine Log Shows Wrong Macro When Macro Error in Sub-Macro

Running Keyboard Maestro 9.0.5 on macOS 10.14.6 (Mojave).

BUG:

When an error occurs in a Sub-Macro (a macro called via Execute Macro), the KM Engine Log shows the Main calling Macro, NOT the Sub-Macro where the error actually occurred.

Proposed Fix

At a minimum the Log entry should show the Sub-Macro Name.
A better fix would be to show both the Sub-Macro and the Main Macro names, maybe something like this:

Macro “Test Calculations [Sub-Macro]” called by Macro “Test Main Macro”

Note: the text "[Sub-Macro]" is part of the name I gave this macro.

KM Engine Log

2020-05-27 11:15:28 Execute macro “Test Main Macro” from trigger Duplicate Macro Palette
2020-05-27 11:15:28 Set Variable to Calculation failed to evaluate TEST__Var1 + TEST__Var2
2020-05-27 11:15:28 Set Variable to Calculation failed to evaluate TEST__Var1 + TEST__Var2 Macro “Test Main Macro” cancelled (while executing Set Variable “TEST__SubMacro_Calc” To Calculation “TEST__Var1 + TEST__Var2”).

Test Macros

MACRO SET: Main Macro and Sub-Macro

[KM9 TEST] Macros.kmmacros (4.2 KB)


Main Macro

image


Sub-Macro

image

This is not a bug, this is working as designed. The entire macro instance is all under the parent macro, and any errors are reported for it.

If I ever implement a solution to report errors in a more formalised way, I might include the full macro trace stack, or the specific macro it is in.

That's too bad. It really makes the error notice almost useless, since the actual error is NOT in the reported Macro.

As a programmer you know the great importance of reporting the stack chain for an error. Please revise your reporting on sub-macros. I would much prefer just the sub-macro name to the parent macro, if we are limited to just having one macro name listed.