error_mcu: Report reactor stats in error_mcu module

Move reactor debugging info from main klippy.py code to error_mcu code
for improved exception handling.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2025-10-08 19:54:22 -04:00
parent f147804d97
commit 38b286db4b
2 changed files with 3 additions and 2 deletions

View File

@@ -93,6 +93,9 @@ class PrinterMCUError:
self._check_mcu_shutdown(msg, details)
else:
self.printer.update_error_msg(msg, "%s%s" % (msg, message_shutdown))
# Report reactor info (no good place to do this, so done here)
logging.info("Reactor garbage collection: %s",
self.printer.get_reactor().get_gc_stats())
def _check_protocol_error(self, msg, details):
host_version = self.printer.start_args['software_version']
msg_update = []

View File

@@ -211,8 +211,6 @@ class Printer:
cb()
except:
logging.exception("Exception during shutdown handler")
logging.info("Reactor garbage collection: %s",
self.reactor.get_gc_stats())
for cb in self.event_handlers.get("klippy:analyze_shutdown", []):
try:
cb(msg, details)