aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/probe.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2018-06-11 21:29:24 -0400
committerKevin O'Connor <kevin@koconnor.net>2018-06-11 21:35:53 -0400
commit3819ad29861dcdc93b2513d5c61151bc74603cd4 (patch)
tree86e710e8708a9eedc1f97d4466ecf18aad883ebe /klippy/extras/probe.py
parente110e1fecc7431187c371224e9235cab9e6a5e71 (diff)
downloadkutter-3819ad29861dcdc93b2513d5c61151bc74603cd4.tar.gz
kutter-3819ad29861dcdc93b2513d5c61151bc74603cd4.tar.xz
kutter-3819ad29861dcdc93b2513d5c61151bc74603cd4.zip
probe: Catch and propagate errors raised during ProbePointsHelper
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/probe.py')
-rw-r--r--klippy/extras/probe.py22
1 files changed, 17 insertions, 5 deletions
diff --git a/klippy/extras/probe.py b/klippy/extras/probe.py
index ee7757fe..99e4e80e 100644
--- a/klippy/extras/probe.py
+++ b/klippy/extras/probe.py
@@ -181,16 +181,24 @@ class ProbePointsHelper:
self.busy = True
self.move_next()
if self.probe is not None:
- while self.busy:
- self.gcode.run_script("PROBE")
- self.cmd_NEXT({})
+ try:
+ while self.busy:
+ self.gcode.run_script("PROBE")
+ self.cmd_NEXT({})
+ except:
+ self.finalize(False)
+ raise
def move_next(self):
x, y = self.probe_points[len(self.results)]
curpos = self.toolhead.get_position()
curpos[0] = x
curpos[1] = y
curpos[2] = self.horizontal_move_z
- self.toolhead.move(curpos, self.speed)
+ try:
+ self.toolhead.move(curpos, self.speed)
+ except homing.EndstopError as e:
+ self.finalize(False)
+ raise self.gcode.error(str(e))
self.gcode.reset_last_position()
cmd_NEXT_help = "Move to the next XY position to probe"
def cmd_NEXT(self, params):
@@ -200,7 +208,11 @@ class ProbePointsHelper:
# Lift toolhead
curpos = self.toolhead.get_position()
curpos[2] = self.horizontal_move_z
- self.toolhead.move(curpos, self.lift_speed)
+ try:
+ self.toolhead.move(curpos, self.lift_speed)
+ except homing.EndstopError as e:
+ self.finalize(False)
+ raise self.gcode.error(str(e))
# Move to next position
if len(self.results) == len(self.probe_points):
self.toolhead.get_last_move_time()