homing: Add EndstopMoveError wrapper around EndstopError

Allow an EndstopError to be raised without a destination position.
Introduce EndstopMoveError wrapper so that current callers can
continue to pass in a move destination.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2016-11-18 12:42:39 -05:00
parent 2b5b899d35
commit 4f30dce64f
4 changed files with 15 additions and 11 deletions

View file

@ -84,8 +84,9 @@ class CartKinematics:
and (end_pos[i] < self.limits[i][0]
or end_pos[i] > self.limits[i][1])):
if self.limits[i][0] > self.limits[i][1]:
raise homing.EndstopError(end_pos, "Must home axis first")
raise homing.EndstopError(end_pos)
raise homing.EndstopMoveError(
end_pos, "Must home axis first")
raise homing.EndstopMoveError(end_pos)
def check_move(self, move):
limits = self.limits
xpos, ypos = move.end_pos[:2]