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 <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-03-16 01:08:26 -04:00
parent df6d3107f2
commit 9bb8b0c622
1 changed files with 6 additions and 3 deletions

View File

@ -365,6 +365,9 @@ class ToolHead:
return "print_time=%.3f buffer_time=%.3f print_stall=%d" % ( return "print_time=%.3f buffer_time=%.3f print_stall=%d" % (
print_time, buffer_time, self.print_stall) print_time, buffer_time, self.print_stall)
def force_shutdown(self): def force_shutdown(self):
try:
self.printer.mcu.force_shutdown() self.printer.mcu.force_shutdown()
self.move_queue.reset() self.move_queue.reset()
self.reset_print_time() self.reset_print_time()
except:
logging.exception("Exception in force_shutdown")