From 3ddbd34a7c4b9cbe1676625162d4638cfad0b408 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 1 Feb 2018 12:13:48 -0500 Subject: [PATCH] gcode: Propagate errors from run_script() If the script being run raises an error, then stop running that script and return the error to the caller. Signed-off-by: Kevin O'Connor --- klippy/gcode.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/klippy/gcode.py b/klippy/gcode.py index 8895764f..5a7c50f2 100644 --- a/klippy/gcode.py +++ b/klippy/gcode.py @@ -161,11 +161,15 @@ class GCodeParser: except error as e: self.respond_error(str(e)) self.reset_last_position() + if not need_ack: + raise except: msg = 'Internal error on command:"%s"' % (cmd,) logging.exception(msg) self.printer.invoke_shutdown(msg) self.respond_error(msg) + if not need_ack: + raise self.ack() self.need_ack = prev_need_ack def process_data(self, eventtime):