mirror of
https://github.com/andreili/klipper.git
synced 2025-08-24 03:44:06 +02:00
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:
parent
81277154d2
commit
9aba1a8536
@ -178,8 +178,8 @@ class GCodeMacro:
|
|||||||
literal = ast.literal_eval(value)
|
literal = ast.literal_eval(value)
|
||||||
json.dumps(literal, separators=(',', ':'))
|
json.dumps(literal, separators=(',', ':'))
|
||||||
except (SyntaxError, TypeError, ValueError) as e:
|
except (SyntaxError, TypeError, ValueError) as e:
|
||||||
raise gcmd.error("Unable to parse '%s' as a literal: %s" %
|
raise gcmd.error("Unable to parse '%s' as a literal: %s in '%s'" %
|
||||||
(value, e))
|
(value, e, gcmd.get_commandline()))
|
||||||
v = dict(self.variables)
|
v = dict(self.variables)
|
||||||
v[variable] = literal
|
v[variable] = literal
|
||||||
self.variables = v
|
self.variables = v
|
||||||
|
Loading…
x
Reference in New Issue
Block a user