Skip to content

Commit

Permalink
Merge pull request nus-cs2113-AY2324S2#31 from yeozongyao/branch-zong…
Browse files Browse the repository at this point in the history
…yao-defensiveCoding

Improved user experience - use help command when command is invalid
  • Loading branch information
yeozongyao authored Mar 21, 2024
2 parents a3645f6 + e55e2db commit 3af8853
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/main/java/seedu/bookbuddy/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ public static void parseCommand( String input, BookList books) {
break;
default:
LOGGER.log(Level.WARNING, "Sorry but that is not a valid command. Please try again", command);
throw new UnsupportedCommandException("Sorry but that is not a valid command. Please try again");
throw new UnsupportedCommandException("Sorry but that is not a valid command. " +
"Please try again or type: help");
}
} catch (NumberFormatException e) {
throw new InvalidBookIndexException("Book index must be an integer.");
Expand Down
2 changes: 1 addition & 1 deletion text-ui-test/EXPECTED.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Hello from
BookBuddy!
How can I help you today?
_____________
Sorry but that is not a valid command. Please try again
Sorry but that is not a valid command. Please try again or type: help

0 comments on commit 3af8853

Please sign in to comment.