Skip to content

Commit

Permalink
UPDATE: throw exception on invalid unit input
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcel committed Feb 10, 2020
1 parent 8adeb76 commit 37daf5d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ private static String getUnit(String distance) {
} else if (unit.compareTo("mi") == 0) {
return "miles";
}
return "";
throw new IllegalArgumentException("No matching major unit.");
}
}

0 comments on commit 37daf5d

Please sign in to comment.