homing: Remove EndstopError

There's no reason to distinguish between an EndstopError and a
CommandError, so just use CommandError.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2020-09-04 11:41:57 -04:00
parent 1f3a160f47
commit f6dd97b784
11 changed files with 21 additions and 25 deletions

View file

@ -107,13 +107,13 @@ class PrinterExtruder:
def check_move(self, move):
axis_r = move.axes_r[3]
if not self.heater.can_extrude:
raise homing.EndstopError(
raise self.printer.command_error(
"Extrude below minimum temp\n"
"See the 'min_extrude_temp' config option for details")
if (not move.axes_d[0] and not move.axes_d[1]) or axis_r < 0.:
# Extrude only move (or retraction move) - limit accel and velocity
if abs(move.axes_d[3]) > self.max_e_dist:
raise homing.EndstopError(
raise self.printer.command_error(
"Extrude only move too long (%.3fmm vs %.3fmm)\n"
"See the 'max_extrude_only_distance' config"
" option for details" % (move.axes_d[3], self.max_e_dist))
@ -127,7 +127,7 @@ class PrinterExtruder:
area = axis_r * self.filament_area
logging.debug("Overextrude: %s vs %s (area=%.3f dist=%.3f)",
axis_r, self.max_extrude_ratio, area, move.move_d)
raise homing.EndstopError(
raise self.printer.command_error(
"Move exceeds maximum extrusion (%.3fmm^2 vs %.3fmm^2)\n"
"See the 'max_extrude_cross_section' config option for details"
% (area, self.max_extrude_ratio * self.filament_area))