From d6c0d966463f1d5adc03404a20f56cd69b84ae7e Mon Sep 17 00:00:00 2001 From: nubnubyas Date: Thu, 21 Sep 2023 19:06:12 +0800 Subject: [PATCH] Clean up code for release --- src/main/java/monday/monday/parser/Parser.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/java/monday/monday/parser/Parser.java b/src/main/java/monday/monday/parser/Parser.java index 02575372bf..25b1700371 100644 --- a/src/main/java/monday/monday/parser/Parser.java +++ b/src/main/java/monday/monday/parser/Parser.java @@ -27,7 +27,6 @@ private enum Command { EVENT, DELETE, FIND, - DEFAULT, } /** @@ -56,7 +55,8 @@ public String parseCommands(String userInput) throws MondayException { try { commandEnum = Command.valueOf(command.toUpperCase()); } catch (IllegalArgumentException e) { - commandEnum = Command.DEFAULT; + throw new MondayException("Sorry, I do not understand what that means.\n" + + "Please provide a valid input/command. e.g todo read book"); } switch (commandEnum) { @@ -78,9 +78,6 @@ public String parseCommands(String userInput) throws MondayException { return deleteCommand(content); case FIND: return findCommand(content); - case DEFAULT: - throw new MondayException("Sorry, I do not understand what that means.\n" - + "Please provide a valid input/command. e.g todo read book"); default: throw new MondayException("Sorry the ChatBot, please kindly wait for update."); }