mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-16 03:07:56 -06:00
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>
This commit is contained in:
parent
dbdf1e137e
commit
524e0290bc
3 changed files with 69 additions and 19 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue