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 <kevin@koconnor.net>
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user