Open lixupengg opened 4 years ago
Thank you for the bug reported
However, we cannot accept this bug.
Look at error message, we did mention that the index need to be positive integer. Thus, 0 is not a valid index.
Thus, an error is thrown saying that the command is invalid.
Team chose [response.Rejected
]
Reason for disagreement: Hi there,
I understand that having a valid index parameter is part of the command.
However, throwing the error that states "Invalid command format!" to the user suggests that the command format that the user entered was wrong, e.g. maybe if he entered "delete d/Food", then the command format is wrong.
BUT in the case of the user entering "delete 0", this command format is ACCURATE (but with invalid parameters), thus the wrong error ("Invalid command format") is being thrown, which would lead to the user being confused as he would not be sure what is wrong with the command format he entered, since he is following the command format suggested already.
Thus, what is wrong about this command "delete 0", is NOT the command format, but is as you said, the invalid index. Therefore an error stating that the index is invalid should be displayed to the user instead so as to not confuse the user with the wrong cause of his problem.
When deleting an invalid index, the error message The expense index provided is invalid should be thrown. However, when deleting an invalid index (0, or negative), wrong message is thrown.