From 9bb8b0c622bf5cba38e5e2c4b59b466444e572d7 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 16 Mar 2017 01:08:26 -0400 Subject: [PATCH] toolhead: Don't raise exception from force_shutdown Catch and ignore any exceptions when trying to shutdown the printer in toolhead.force_shutdown() - there's a good chance an exception will be raised as this method is often called after an invalid internal state is found. Signed-off-by: Kevin O'Connor --- klippy/toolhead.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/klippy/toolhead.py b/klippy/toolhead.py index edd24bc3..95aceafa 100644 --- a/klippy/toolhead.py +++ b/klippy/toolhead.py @@ -365,6 +365,9 @@ class ToolHead: return "print_time=%.3f buffer_time=%.3f print_stall=%d" % ( print_time, buffer_time, self.print_stall) def force_shutdown(self): - self.printer.mcu.force_shutdown() - self.move_queue.reset() - self.reset_print_time() + try: + self.printer.mcu.force_shutdown() + self.move_queue.reset() + self.reset_print_time() + except: + logging.exception("Exception in force_shutdown")