CaptainKeqing / ped

0 stars 0 forks source link

Uncaught IllegalArgumentException in order command #3

Open CaptainKeqing opened 7 months ago

CaptainKeqing commented 7 months ago

Problem

For your order command, it seems that there are many uncaught IllegalArgumentExceptions.

This causes there to be no feedback given to the user that they have entered something wrong. The only feedback is shown in the terminal used to run the jar file which the user probably won't notice.

Commands executed

Command: order 1 d/1xRoses c/-1 by/23-07-2024 00:00

Problem with it: Negative Price Expected feedback: Error message about invalid price in feedback box in the app *Actual feedback: None. Only in terminal

image.png

Command: order 1 d/1xRoses c/1 by/40-07-2024 00:00

Problem with it: Invalid Day Expected feedback: Error message about invalid day in feedback box in the app *Actual feedback: None. Only in terminal

image.png

Command: order 1 d/1xRoses c/1 by/23-07-2024

Problem with it: Missing time fields Expected feedback: Error message about invalid datetime in feedback box in the app *Actual feedback: None. Only in terminal

image.png

Command: order 1 d/ c/40 by/23-07-2024 00:00

Problem with it: Blank description Expected feedback: Error message about blank description in feedback box in the app *Actual feedback: None. Only in terminal image.png

Recommended Fix

Perhaps it would be good to throw error messages here ! Need to add exception checks to the code to account for these invalid input cases.