gcode_macro: more descriptive "unable to parse as a literal" error - display faulty command

Signed-off-by: Mateusz Szwedka <matszwe02@gmail.com>
This commit is contained in:
Matszwe02 2025-05-04 21:45:31 +02:00 committed by KevinOConnor
parent 81277154d2
commit 9aba1a8536

View File

@ -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