util: Try to dump mcu build information on a connection error

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2020-03-22 13:20:07 -04:00
parent eeee2a9a35
commit f3667fd453
2 changed files with 57 additions and 2 deletions

View file

@ -144,10 +144,12 @@ class Printer:
except msgproto.error as e:
logging.exception("Protocol error")
self._set_state("%s%s" % (str(e), message_protocol_error))
util.dump_mcu_build()
return
except mcu.error as e:
logging.exception("MCU error during connect")
self._set_state("%s%s" % (str(e), message_mcu_connect_error))
util.dump_mcu_build()
return
except Exception as e:
logging.exception("Unhandled exception during connect")