gcode: Exit on an unhandled exception when reading from a file

When testing via a gcode input file, it's easier to debug problems if
the program exits upon the first exception.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-02-05 14:01:24 -05:00
parent 4194ebf9df
commit 667b72870f
1 changed files with 3 additions and 0 deletions

View File

@ -114,6 +114,9 @@ class GCodeParser:
logging.exception("Exception in command handler")
self.toolhead.force_shutdown()
self.respond_error('Internal error on command:"%s"' % (cmd,))
if self.is_fileinput:
self.printer.request_exit_eof()
break
self.ack()
def process_data(self, eventtime):
data = os.read(self.fd, 4096)