paing-oo / pe

0 stars 0 forks source link

Delete Applicant Command shows wrong error message when index is 0. #1

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 -a command on index 9 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 -a 0

Expected error message:

The applicant index provided is invalid (which is shown when delete -a 9 is used instead and the applicant list is of size 8)

Actual error message shown:

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

image.png

soc-pe-bot 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.