aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/probe.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2020-09-04 11:49:43 -0400
committerKevin O'Connor <kevin@koconnor.net>2020-09-04 12:10:36 -0400
commit08adecd226b4d712eb900b1768a7a96294a89c20 (patch)
treef264d23bcbf096388e35345d525bcac3afa5bdd6 /klippy/extras/probe.py
parentf6dd97b78443548c236038ce50a69c24866e156d (diff)
downloadkutter-08adecd226b4d712eb900b1768a7a96294a89c20.tar.gz
kutter-08adecd226b4d712eb900b1768a7a96294a89c20.tar.xz
kutter-08adecd226b4d712eb900b1768a7a96294a89c20.zip
homing: Prefer printer.command_error() instead of homing.CommandError()
Update callers to use the printer.command_error reference instead of directly using homing.CommandError() when raising or catching errors. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/probe.py')
-rw-r--r--klippy/extras/probe.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/klippy/extras/probe.py b/klippy/extras/probe.py
index d97a5e7f..9b4f1cb0 100644
--- a/klippy/extras/probe.py
+++ b/klippy/extras/probe.py
@@ -115,11 +115,11 @@ class PrinterProbe:
try:
homing_state.homing_move(pos, endstops, speed,
probe_pos=True, verify_movement=verify)
- except homing.CommandError as e:
+ except self.printer.command_error as e:
reason = str(e)
if "Timeout during endstop homing" in reason:
reason += HINT_TIMEOUT
- raise homing.CommandError(reason)
+ raise self.printer.command_error(reason)
pos = toolhead.get_position()
self.gcode.respond_info("probe at %.3f,%.3f is z=%.6f"
% (pos[0], pos[1], pos[2]))
@@ -162,8 +162,7 @@ class PrinterProbe:
z_positions = [p[2] for p in positions]
if max(z_positions) - min(z_positions) > samples_tolerance:
if retries >= samples_retries:
- raise homing.CommandError(
- "Probe samples exceed samples_tolerance")
+ raise gcmd.error("Probe samples exceed samples_tolerance")
gcmd.respond_info("Probe samples exceed tolerance. Retrying...")
retries += 1
positions = []
@@ -295,14 +294,14 @@ class ProbeEndstopWrapper:
start_pos = toolhead.get_position()
self.activate_gcode.run_gcode_from_command()
if toolhead.get_position()[:3] != start_pos[:3]:
- raise homing.CommandError(
+ raise self.printer.command_error(
"Toolhead moved during probe activate_gcode script")
def probe_finish(self):
toolhead = self.printer.lookup_object('toolhead')
start_pos = toolhead.get_position()
self.deactivate_gcode.run_gcode_from_command()
if toolhead.get_position()[:3] != start_pos[:3]:
- raise homing.CommandError(
+ raise self.printer.command_error(
"Toolhead moved during probe deactivate_gcode script")
def get_position_endstop(self):
return self.position_endstop