Open kohkaijie opened 10 months ago
No details provided by team.
[The team marked this bug as a duplicate of the following bug]
Error message for invalid indexes is misleading
Index 0 and negative indexes should be recognised as an invalid index error and not give an invalid command error because the command used was edit, which is a valid command. This can cause confusion to users as the error message is misleading.
![]()
[original: nus-cs2103-AY2324S1/pe-interim#5262] [original labels: severity.Low type.FeatureFlaw]
[This is the team's response to the above 'original' bug]
The error messages are all correct.
For
INDEX
values 0 and -1, the index provided is not a positive integer and thus does not follow the command format specified. The command format clearly specifies that
INDEX
(must be a positive integer)and the exact command format is also seen in your screenshot.
With reference to the course website,
if a date input is required to be in YYYY-MM-DD format, 2021-13-28 is a format error (reason: MM should be in 1..12)
Similarly, for the
delete
command, it has to be indelete INDEX
format.delete 0
is a format error (reason:INDEX
should be 1...MAX_INT).Please also refer to the UG, where we stated that
INDEX
has to be an unsigned positive integer.
These INDEX values clearly fail the constraints specified in the command format. Therefore, the commands have invalid formats.
For
INDEX
10, while 10 is a positive integer and fulfils the command format, there is no student with an index 10 in a list of 8 students. Therefore, it is an invalid index.Items for the Tester to Verify
:question: Issue duplicate status
Team chose to mark this issue as a duplicate of another issue (as explained in the Team's response above)
Reason for disagreement: [replace this with your explanation]
Steps to reproduce:
edit 0 n/Jackson
Expected result: Invalid index provided
Actual result: Invalid command format! edit: Edits the details of the person identified by the index number used in the displayed person list. Existing values will be overwritten by the input values. Parameters: INDEX (must be a positive integer) [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [th/TELEHANDLE] [t/TAG]... [c/ORIGINAL_COURSE-NEW_COURSE]... Example: edit 1 p/91234567 e/johndoe@example.com c/add-MA1521 c/del-MA1521 c/MA2001-MA1521
The error message returned should have been about a wrong index entered as the command format used was correct.