shaunlxw / pe

0 stars 0 forks source link

removetag command: inaccurate error message #9

Open shaunlxw opened 4 months ago

shaunlxw commented 4 months ago

Input: removetag 1 2 t/hi

Provided index of 1 and 2 are non-zero unsigned integers but the error message says they are not.

image.png

nus-pe-bot commented 4 months ago

Team's Response

The error message is indeed correct as the example INDEX provided, 1 2, is indeed not a non-zero unsigned integer since the input contains a whitespace.

Items for the Tester to Verify

:question: Issue response

Team chose [response.Rejected]

Reason for disagreement: The response by the team is with the understanding of how the parser for this command works, that everything before the t/ flag is taken as the preamble and then parsed as index. This understanding does not apply to the user. The inner workings of the parser cannot be known without looking at the code; it is possible for the parsing to only take the first item after the command word, split by space, while the rest are considered tags, in which then the error message is not accurate again, since the index given is a non-zero unsigned integer.

In any case, the main point of this issue is that the error message is inaccurate in the sense that it doesn't help the user in recovering from this specific error. In UG, the command format is given as removetag INDEX t/TAG…. It is possible although unlikely (which is why severity is low) that the user misunderstands the command usage, and assumes the command can remove a specific tag on multiple persons, e.g. removetag 1 2 t/friend as in removing the friend tag from person at index 1 and 2. Doing so will lead to the above error message of "Index is not a non-zero unsigned integer" in which the UG shows the below solution.

image.png

This confuses the user as both the indexes given are positive integers. Hence it is a bug as the given error message does not help the user recover from the error but instead further confuses the user.

The actual error message should either be invalid command format, or a more specific one saying only one index can be provided.