diff --git a/src/main/java/seedu/address/logic/parser/AddGradeCommandParser.java b/src/main/java/seedu/address/logic/parser/AddGradeCommandParser.java index 8421352dd20..6ccbf8e147d 100644 --- a/src/main/java/seedu/address/logic/parser/AddGradeCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/AddGradeCommandParser.java @@ -15,6 +15,8 @@ * Parses input arguments and creates a new AddGradeCommand object */ public class AddGradeCommandParser implements Parser { + 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 { @@ -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); } } /**