aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/mcu.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2016-11-30 14:30:45 -0500
committerKevin O'Connor <kevin@koconnor.net>2016-11-30 21:19:44 -0500
commit524e0290bce93b2bf2565a631c6cf0812a728401 (patch)
treedf4ea00e2fa35d9f253f4a184780ab0027199412 /klippy/mcu.py
parentdbdf1e137e74392a7aa0858d524498a41bddabea (diff)
downloadkutter-524e0290bce93b2bf2565a631c6cf0812a728401.tar.gz
kutter-524e0290bce93b2bf2565a631c6cf0812a728401.tar.xz
kutter-524e0290bce93b2bf2565a631c6cf0812a728401.zip
klippy: Improve error reporting during connect
Catch exceptions during the connect phase and report them via the gcode interface to the user. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/mcu.py')
-rw-r--r--klippy/mcu.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/klippy/mcu.py b/klippy/mcu.py
index 2e15287f..e039f2d5 100644
--- a/klippy/mcu.py
+++ b/klippy/mcu.py
@@ -336,7 +336,7 @@ class MCU:
self.is_shutdown = True
logging.info("%s: %s" % (params['#name'], params['#msg']))
self.serial.dump_debug()
- self._printer.note_shutdown()
+ self._printer.note_shutdown(params['#msg'])
# Connection phase
def connect(self):
if not self._is_fileoutput:
@@ -421,8 +421,7 @@ class MCU:
if not self._is_fileoutput:
config_params = self.serial.send_with_response(msg, 'config')
if self._config_crc != config_params['crc']:
- logging.error("Printer CRC does not match config")
- sys.exit(1)
+ raise error("Printer CRC does not match config")
logging.info("Configured")
stepqueues = tuple(s._stepqueue for s in self._steppers)
self._steppersync = self.ffi_lib.steppersync_alloc(