aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatszwe02 <49353902+Matszwe02@users.noreply.github.com>2025-05-04 21:45:31 +0200
committerKevinOConnor <kevin@koconnor.net>2025-05-08 11:37:38 -0400
commit9aba1a8536a219b0a920d8ba709da54637eea5ac (patch)
treedfc1eeb82dd426e848bb05461249ca8ca41415c8
parent81277154d2e369d0f0674f75c35e6337084578fb (diff)
downloadkutter-9aba1a8536a219b0a920d8ba709da54637eea5ac.tar.gz
kutter-9aba1a8536a219b0a920d8ba709da54637eea5ac.tar.xz
kutter-9aba1a8536a219b0a920d8ba709da54637eea5ac.zip
gcode_macro: more descriptive "unable to parse as a literal" error - display faulty command
Signed-off-by: Mateusz Szwedka <matszwe02@gmail.com>
-rw-r--r--klippy/extras/gcode_macro.py4
1 files 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