klippy: Fix error handling during connect phase
Make sure to exit the _connect() method if a connect event handler raises an error. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
bf647749dd
commit
c0ea0312e5
|
@ -137,16 +137,20 @@ class Printer:
|
|||
except (self.config_error, pins.error) as e:
|
||||
logging.exception("Config error")
|
||||
self._set_state("%s%s" % (str(e), message_restart))
|
||||
return
|
||||
except msgproto.error as e:
|
||||
logging.exception("Protocol error")
|
||||
self._set_state("%s%s" % (str(e), message_protocol_error))
|
||||
return
|
||||
except mcu.error as e:
|
||||
logging.exception("MCU error during connect")
|
||||
self._set_state("%s%s" % (str(e), message_mcu_connect_error))
|
||||
return
|
||||
except:
|
||||
logging.exception("Unhandled exception during connect")
|
||||
self._set_state("Internal error during connect.%s" % (
|
||||
message_restart,))
|
||||
return
|
||||
try:
|
||||
self._set_state(message_ready)
|
||||
for cb in self.event_handlers.get("klippy:ready", []):
|
||||
|
|
Loading…
Reference in New Issue