Skip to content

Commit

Permalink
Update Parser.java
Browse files Browse the repository at this point in the history
Changed parsePriority method to return error message based on incorrect input

Update parsePriority method
  • Loading branch information
Darkarche3 committed Feb 26, 2024
1 parent b51cf26 commit 524ea4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/area/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public String parseKeyword(String instruction) {

public String parsePriority(String instruction){
String[] sentence = instruction.split(" ", 3);
if (sentence.length == 1) {
if (sentence.length != 3) {
throw new IllegalArgumentException("Your input is incomplete. I need a priority for this task.");
} else {
return sentence[2];
Expand Down

0 comments on commit 524ea4c

Please sign in to comment.