aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/gcode.py
diff options
context:
space:
mode:
Diffstat (limited to 'klippy/gcode.py')
-rw-r--r--klippy/gcode.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/klippy/gcode.py b/klippy/gcode.py
index ad05b0d5..f6f64d1e 100644
--- a/klippy/gcode.py
+++ b/klippy/gcode.py
@@ -101,7 +101,8 @@ class GCodeParser:
handler(params)
except:
logging.exception("Exception in command handler")
- self.respond('echo:Internal error on command:"%s"' % (cmd,))
+ self.toolhead.force_shutdown()
+ self.respond('Error: Internal error on command:"%s"' % (cmd,))
# Check if machine can process next command or must stall input
if self.busy_state is not None:
break
@@ -142,7 +143,13 @@ class GCodeParser:
self.busy_state = busy_handler
self.reactor.update_timer(self.busy_timer, self.reactor.NOW)
def busy_handler(self, eventtime):
- busy = self.busy_state.check_busy(eventtime)
+ try:
+ busy = self.busy_state.check_busy(eventtime)
+ except:
+ logging.exception("Exception in busy handler")
+ self.toolhead.force_shutdown()
+ self.respond('Error: Internal error in busy handler')
+ busy = False
if busy:
self.toolhead.reset_motor_off_time(eventtime)
return eventtime + self.RETRY_TIME