Skip to content

Commit

Permalink
Improve logs msg for command related exception
Browse files Browse the repository at this point in the history
Logger will log "Invaid Command: <command text>" when a CommandException
or ParseException occur.

However, the exceptions might be caused by other issuess like unable to
write to save file etc.
Therefore, the current log message is not suitable for CommandException.

Let's improve the accuracy of the error message by changing it to
accurately describe both CommandException and ParseException.
  • Loading branch information
Eclipse-Dominator authored and damithc committed Jul 13, 2023
1 parent c07fb9e commit bd48d59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/ui/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ private CommandResult executeCommand(String commandText) throws CommandException

return commandResult;
} catch (CommandException | ParseException e) {
logger.info("Invalid command: " + commandText);
logger.info("An error occurred while executing command: " + commandText);
resultDisplay.setFeedbackToUser(e.getMessage());
throw e;
}
Expand Down

0 comments on commit bd48d59

Please sign in to comment.