diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2018-06-16 15:15:17 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2018-06-16 16:18:01 -0400 |
commit | 780e3c3022ad6231073f7078f96e67ba15039678 (patch) | |
tree | c1f19fa35eaf64eaf6281c2c39a734e313ee01aa /klippy/gcode.py | |
parent | efe63d5efe3ab6ca9e08a42dceca0607d7fa0915 (diff) | |
download | kutter-780e3c3022ad6231073f7078f96e67ba15039678.tar.gz kutter-780e3c3022ad6231073f7078f96e67ba15039678.tar.xz kutter-780e3c3022ad6231073f7078f96e67ba15039678.zip |
klippy: Return an error code if batch input results in an error
When reading from a debug input file, propagate any errors to the
program return status.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/gcode.py')
-rw-r--r-- | klippy/gcode.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/klippy/gcode.py b/klippy/gcode.py index be45d28f..1883ae0e 100644 --- a/klippy/gcode.py +++ b/klippy/gcode.py @@ -105,7 +105,7 @@ class GCodeParser: self.gcode_handlers = self.base_gcode_handlers self.dump_debug() if self.is_fileinput: - self.printer.request_exit() + self.printer.request_exit('error_exit') return if state != 'ready': return @@ -264,6 +264,8 @@ class GCodeParser: if len(lines) > 1: self.respond_info("\n".join(lines)) self.respond('!! %s' % (lines[0].strip(),)) + if self.is_fileinput: + self.printer.request_exit('error_exit') # Parameter parsing helpers class sentinel: pass def get_str(self, name, params, default=sentinel, parser=str, |