Skip to content

Commit

Permalink
Merge pull request #195
Browse files Browse the repository at this point in the history
Delete Tag has no error message
  • Loading branch information
CYX22222003 authored Nov 2, 2024
2 parents 94b6c22 + a03bb67 commit 1b736bc
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static java.util.Objects.requireNonNull;
import static seedu.address.logic.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
import static seedu.address.logic.Messages.MESSAGE_TAG_NOT_FOUND;
import static seedu.address.logic.commands.DeleteTagCommand.MESSAGE_USAGE;
import static seedu.address.logic.parser.CliSyntax.PREFIX_TAG;

import seedu.address.commons.core.index.Index;
Expand All @@ -21,14 +22,15 @@ public class DeleteTagCommandParser implements Parser<DeleteTagCommand> {
*/
public DeleteTagCommand parse(String args) throws ParseException {
requireNonNull(args);
assert !args.isEmpty();
// assert !args.isEmpty(); // This causes error to not be displayed properly
ArgumentMultimap argMultiMap = ArgumentTokenizer.tokenize(args, PREFIX_TAG);

Index index;

try {
index = ParserUtil.parseIndex(argMultiMap.getPreamble());
} catch (ParseException pe) {
throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, DeleteTagCommand.MESSAGE_USAGE), pe);
throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, MESSAGE_USAGE), pe);
}

argMultiMap.verifyNoDuplicatePrefixesFor(PREFIX_TAG);
Expand Down

0 comments on commit 1b736bc

Please sign in to comment.