AY2223S2-CS2113-T12-4 / tp

0 stars 5 forks source link

[Bug] Insufficient exception handling for invalid home command of atomic habits #139

Closed haoyangw closed 1 year ago

haoyangw commented 1 year ago

Describe the bug Giving an invalid home command sometimes throws the generic BadCommandException instead of one with the specific invalid home command message that's introduced in #125.

To Reproduce One method to reproduce the behavior:

  1. Issue hb command
  2. Issue home --Test, which throws the specific invalid home command message introduced in #125
  3. Issue home Test, which now throws the generic BadCommandException message from MainManager
  4. User was taken back to MainManager already, even though home Test is not a valid home command

Another method to reproduce the behavior:

  1. Issue hb command
  2. Issue home Test, which throws the specific invalid home command message introduced in #125
  3. Issue home --Test, which now throws the generic BadCommandException message from MainManager
  4. User was taken back to MainManager already, even though home Test is not a valid home command

Expected behavior Step 3 in both test cases above should give user the specific invalid home command message introduced in #125, and user should not be taken back to MainManager.

wenxin-c commented 1 year ago

This bug has been fixed, users will not go back MainManager if home command is invalid. image

haoyangw commented 1 year ago

Fixed by #203, closing this