Open tsy24 opened 2 years ago
It is already stated in the first screenshot that the index should be a positive integer, and so this error message does explain why the command was invalid.
Team chose [response.Rejected
]
Reason for disagreement: As both 0, negative numbers, and numbers greater than the length of the student list are invalid indexes, the error message when the user enters a correct command format with an invalid index should be the same. Thus, del -s 0
, del -s -1
and del -s 10
should all throw the same error message, which is the invalid index error message.
While there is some information on the index in the invalid command format error message, the invalid command format message should be thrown only if the user entered a command that does not follow the format, regardless of whether the parameters are valid, eg. del -s
or del -s sn/alex yeoh
. In del -s 0
, the format of the command is correct, so the incorrect command format message should not be thrown. Instead, the more specific invalid index error message should be thrown.
When users key in an incorrect index 0, the error message is that the command format is invalid.
Eg.
del -s 0
On the other hand, other invalid index such as 10 which is greater than the size of the current student list gives the invalid index error message.
Eg.
del -s 10
As both are invalid indexes, I believe the error message for index 0 should be the invalid index error message.