mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-08 07:27:43 -06:00
gcode: Simplify exception handling
Translate caught exceptions into a gcode.error() exception. This way there is one standard place to invoke respond_error(). Also, always reset the last_position on a handled error. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
3a2d16abb3
commit
80f23441dd
2 changed files with 21 additions and 20 deletions
|
@ -328,7 +328,11 @@ class ToolHead:
|
|||
if self.print_time > self.need_check_stall:
|
||||
self._check_stall()
|
||||
def home(self, homing_state):
|
||||
self.kin.home(homing_state)
|
||||
try:
|
||||
self.kin.home(homing_state)
|
||||
except homing.EndstopError as e:
|
||||
self.motor_off()
|
||||
raise
|
||||
def dwell(self, delay, check_stall=True):
|
||||
self.get_last_move_time()
|
||||
self.update_move_time(delay)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue