From 3990d997de7a38afdeb18a53674ea8e2e68092d4 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 23 Apr 2020 16:32:52 -0400 Subject: z_tilt: Raise a gcode.error() instead of directly calling respond_error() Raising an error (instead of reporting an error) is important as only a raised error will stop a print from virtual_sdcard. Signed-off-by: Kevin O'Connor --- klippy/extras/z_tilt.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'klippy/extras/z_tilt.py') diff --git a/klippy/extras/z_tilt.py b/klippy/extras/z_tilt.py index 9784372e..e4f4b18a 100644 --- a/klippy/extras/z_tilt.py +++ b/klippy/extras/z_tilt.py @@ -94,10 +94,8 @@ class RetryHelper: return error = max(z_positions) - min(z_positions) if self.check_increase(error): - self.gcode.respond_error( - "Retries aborting: %s is increasing. %s" % ( - self.value_label, self.error_msg_extra)) - return + raise self.gcode.error("Retries aborting: %s is increasing. %s" + % (self.value_label, self.error_msg_extra)) self.gcode.respond_info( "Retries: %d/%d %s: %0.6f tolerance: %0.6f" % ( self.current_retry, self.max_retries, self.value_label, @@ -106,8 +104,7 @@ class RetryHelper: return "done" self.current_retry += 1 if self.current_retry > self.max_retries: - self.gcode.respond_error("Too many retries") - return + raise self.gcode.error("Too many retries") return "retry" class ZTilt: -- cgit v1.2.3-70-g09d2