klippy: Report the underlying error on an internal error during connect

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2019-04-04 18:37:20 -04:00
parent 79ecee0996
commit 516fbf4f32
1 changed files with 6 additions and 5 deletions

View File

@ -147,10 +147,10 @@ class Printer:
logging.exception("MCU error during connect") logging.exception("MCU error during connect")
self._set_state("%s%s" % (str(e), message_mcu_connect_error)) self._set_state("%s%s" % (str(e), message_mcu_connect_error))
return return
except: except Exception as e:
logging.exception("Unhandled exception during connect") logging.exception("Unhandled exception during connect")
self._set_state("Internal error during connect.%s" % ( self._set_state("Internal error during connect: %s\n%s" % (
message_restart,)) str(e), message_restart,))
return return
try: try:
self._set_state(message_ready) self._set_state(message_ready)
@ -158,9 +158,10 @@ class Printer:
if self.state_message is not message_ready: if self.state_message is not message_ready:
return return
cb() cb()
except: except Exception as e:
logging.exception("Unhandled exception during ready callback") logging.exception("Unhandled exception during ready callback")
self.invoke_shutdown("Internal error during ready callback") self.invoke_shutdown("Internal error during ready callback: %s" % (
str(e),))
def run(self): def run(self):
systime = time.time() systime = time.time()
monotime = self.reactor.monotonic() monotime = self.reactor.monotonic()