mitchmalvin1 / pe

0 stars 0 forks source link

inconsistent exception catching for `review` #12

Open mitchmalvin1 opened 1 year ago

mitchmalvin1 commented 1 year ago

Screenshot 2023-04-14 at 5.13.18 PM.png

The program is able to catch revieww but not review w just because w comes after a whitespace. This is inconsistent as both errors should be classified under Invalid Syntax exception.

nus-se-bot commented 1 year ago

Team's Response

review w is equivalent to review as the program tries it best to still make the command work despite it having unexpected components. revieww is an invalid command. Hence the behaviour here is intended.

The 'Original' Bug

[The team marked this bug as a duplicate of the following bug]

Certain words are ignored input

Input:

add [RANDOM WORDS] /q [QUESTION] /a [ANSWER]

add can be replaced with clear, help, review, bye

Expected:

The input is in an incorrect format.
You can view our user guide or type help to see the correct formats for commands.

==========================================================

Actual:

You have added the following card:
Q:[QUESTION]
A:[ANSWER]
==========================================================

Proof:

image.png

Cases where extra words are not ignored: list all [RANDOM WORDS]

image.png

Apologies if this is an intended behaviour.


[original: nus-cs2113-AY2223S2/pe-interim#2026] [original labels: severity.Low type.FeatureFlaw]

Their Response to the 'Original' Bug

[This is the team's response to the above 'original' bug]

It is the intended behavior for the program to ignore the text not behind any option function (eg: /q). I believe that our user guide already indicates that when adding a question by add /q QUESTION /a ANSWER, only QUESTION and ANSWER would be recorded into the system.

The program tries its best to recover from user mistakes, by ignoring options that are not relevant to its operation, instead of throwing completely and forcing the user to retype. It doesn't allow typo so you can't get away with reviuw but it will ignore arguments it don't care if they exist, and that's entirely by design.

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]


## :question: Issue response Team chose [`response.Rejected`] - [x] I disagree **Reason for disagreement:** Similar to my previous response, the team's UG only mentions that for `card add`, it will ignore all **options** except the last ones. It does not say anything about **trailing arguments** that do not belong to any option. The team is simply trying to cover up a bug using a preemptive that is for a totally different bug. It is very convenient to say "the program tries its best to recover from user mistakes" even though the reality is that it does not bother to catch the exception. I believe that this is a valid bug that the author must acknowledge. ![Screenshot 2023-04-19 at 10.53.40 AM.png](https://raw.githubusercontent.com/mitchmalvin1/pe/main/files/14e6e8ac-caa0-41e0-a8ff-e24df15fbdd2.png)