swongts / pe

0 stars 0 forks source link

Wrong error message thrown #8

Open swongts opened 2 years ago

swongts commented 2 years ago

image.png

Even though /1 is an invalid food category, the error thrown was that integer could not be parsed.

Error thrown should be this instead:

image.png

nus-se-bot commented 2 years ago

Team's Response

The errors thrown in this case are justified. For starters, there are 2 different add mealplan command options as follows:

  1. add /mealplan INDEX_OF_MEALPLAN
  2. add /mealplan /MEALTYPE INDEX_OF_MEALPLAN

This was stated in the UG as add /mealplan [/MEALTYPE] INDEX_OF_MEALPLAN, where the square brackets indicate optional input

For the first error, the parser is assuming you intended to enter option 1 and as such, saying integer could not be parsed as "/1" is not an integer For the second error, the parser is assuming you intended to enter option 2 and as such, parsing "/1" as a mealtype. Since it is not a mealtype, it is throwing that error. As such, the error throwing in this case is consistent and as intended.

Items for the Tester to Verify

:question: Issue response

Team chose [response.Rejected]

Reason for disagreement: [replace this with your explanation]