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 <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2018-02-01 12:13:48 -05:00
parent 67f9c4948d
commit 3ddbd34a7c
1 changed files with 4 additions and 0 deletions

View File

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