Open nus-pe-bot opened 4 years ago
These two error cases are different, therefore it is justified to use different error messages.
In the first case: input edit 0 d/easy
, the invalid command format error was shown as the parameter 0 is not a positive integer. 0 will always be an invalid input, because the list does not start from 0. Therefore, a more descriptive error message is needed to remind users of the accepted command format.
In the second case: input edit 5 d/easy
, the invalid flashcard index error was shown because there are only 4 flashcards in the glossary but the user tried to edit the 5th flashcard. The command format is still valid (since the integer entered is positive), but the index itself is not in this case because the list contains less than 5 flashcards.
The first case reflects an invalid command format error, the second case reflects an invalid index error. The error messages are differentiated based on these cases.
--
Steps to replicate:
The same index out of bounds error result in different error message shown.
(for step 2)
(for step 3)
[original: nus-cs2103-AY2021S1/pe-interim#5588]