Skip to content

Commit

Permalink
Merge branch 'master' into branch-addPageBreaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Incogdino authored Nov 7, 2024
2 parents d747790 + f6a2ec0 commit d0905d5
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* Parses input arguments and creates a new AddGradeCommand object
*/
public class AddGradeCommandParser implements Parser<AddGradeCommand> {
public static final String EMPTY_NAME = "Assignment name cannot be empty.";
public static final String EMPTY_SCORE = "Score cannot be empty.";

@Override
public AddGradeCommand parse(String args) throws ParseException {
Expand Down Expand Up @@ -63,11 +65,11 @@ public AddGradeCommand parse(String args) throws ParseException {
*/
private static void checkAssignmentString(String assignmentName, String scoreString) throws ParseException {
if (assignmentName.isEmpty()) {
throw new ParseException("Assignment name cannot be empty.");
throw new ParseException(EMPTY_NAME);
}

if (scoreString.isEmpty()) {
throw new ParseException("Score cannot be empty.");
throw new ParseException(EMPTY_SCORE);
}
}
/**
Expand Down

0 comments on commit d0905d5

Please sign in to comment.