paing-oo / pe

0 stars 0 forks source link

Delete Position Command shows wrong error message when index specified is 0 #2

Open paing-oo opened 2 years ago

paing-oo commented 2 years ago

Since index 0 is out of bound, error message should be invalid index error instead of invalid command format. When testing the delete -p command on index 6 which is also out of bound, an invalid index error is shown, this leads to inconsistency in the error messages for the same type of error which might lead to confusion for the user.

Steps to reproduce:

command: delete -p 0

Expected error message:

The position index provided is invalid (which is shown when delete -p 6 is used instead and the position list is of size 5)

Actual error message shown:

Invalid command format! delete -p : Deletes the position identified by the index number used in the displayed position list. Parameters: INDEX (must be a positive integer) Example: delete -p 1

image.png

nus-se-script commented 2 years ago

Team's Response

The error message clearly states that the INDEX must be a positive integer, and 0 is not a positive integer. Hence, the command format is indeed invalid and the correct message is shown.

Items for the Tester to Verify

:question: Issue response

Team chose [response.Rejected]

Reason for disagreement: Even though the UG states that the index is a positive integer, the error message should be targeted at the specific error instead so that the user knows which part of the command that he has included wrongly. Since there are multiple fields used in the command, it would be inconvenient for the user to analyze through the whole inputted command just to find out which part of the inputted command is wrong.