Skip to content

Commit 08e0192

Browse files
committed
Updated exception type
1 parent 3e8572e commit 08e0192

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/robotpilot/RobotPilot.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,13 +548,13 @@ public boolean isRightMotorMoving() {
548548
// The travelArc method doesn't work yet
549549
// It should not be used, since it only works partly and is totally unusable
550550
@Deprecated
551-
public void travelArc(float distance, int ratio) throws ArithmeticException {
551+
public void travelArc(float distance, int ratio) throws IllegalArgumentException {
552552
// if ratio is -1, the robot will rotate left on the spot, if ration is 1, the robot will rotate right on the spot, and if the ration is something between, the robot will arc forward with the given ratio
553553
// if ration is 0, the robot will travel forward
554554
// distance is the the distance the faster motor will travel
555555
// TODO make the travelArc method work
556556
if (ratio > 1 || ratio < -1) {
557-
throw new ArithmeticException("Invalid ratio");
557+
throw new IllegalArgumentException("Invalid ratio");
558558
} else {
559559
if (ratio == -1) {
560560
int degreesToRotate = (int) (distance / ((float) ((Math.PI * wheelDiameter) / 360)));

0 commit comments

Comments
 (0)