lixupengg / pe

0 stars 0 forks source link

delete-d throws wrong error #9

Open lixupengg opened 4 years ago

lixupengg commented 4 years ago

image.png

Wrong message thrown for delete-d. Invalid index should be thrown instead of wrong command format for index 0.

image.png Delete-d 20 throws the right error.

nus-pe-bot commented 4 years ago

Team's Response

Looking at the UG or the error message more carefully, the first error message is like that because it is specified that a valid delete-d command should have the index being a positive integer. image.png SInce 0 is not a positive integer, "delete-d 0" is an invalid command, so an error is thrown stating the command is invalid.

Only when the command is valid (index is positive), then we proceed to look at whether the user gave a index that is too large. Only if the command is already valid, we give the error specific to index instead of an invalid command error.

Thanks for pointing out!

Items for the Tester to Verify

:question: Issue response

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 d/Food", then the command format is wrong.

BUT in the case of the user entering "delete-d 0", this command format is ACCURATE, 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-d 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.