From 9aba1a8536a219b0a920d8ba709da54637eea5ac Mon Sep 17 00:00:00 2001 From: Matszwe02 <49353902+Matszwe02@users.noreply.github.com> Date: Sun, 4 May 2025 21:45:31 +0200 Subject: [PATCH] gcode_macro: more descriptive "unable to parse as a literal" error - display faulty command Signed-off-by: Mateusz Szwedka --- klippy/extras/gcode_macro.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/klippy/extras/gcode_macro.py b/klippy/extras/gcode_macro.py index f244b344..3aa5087b 100644 --- a/klippy/extras/gcode_macro.py +++ b/klippy/extras/gcode_macro.py @@ -178,8 +178,8 @@ class GCodeMacro: literal = ast.literal_eval(value) json.dumps(literal, separators=(',', ':')) except (SyntaxError, TypeError, ValueError) as e: - raise gcmd.error("Unable to parse '%s' as a literal: %s" % - (value, e)) + raise gcmd.error("Unable to parse '%s' as a literal: %s in '%s'" % + (value, e, gcmd.get_commandline())) v = dict(self.variables) v[variable] = literal self.variables = v