AY2324S2-CS2113T-T09-1 / tp

0 stars 6 forks source link

[PE-D][Tester B] 'add' command does not handle exceptions where quantity is extremely large #205

Closed nus-se-bot closed 7 months ago

nus-se-bot commented 7 months ago

image.png

Quantity value being excessively large when adding a medicine causes unhandled exception.

Could implement check in parser to prevent this or could implement exception handler.


Labels: type.FunctionalityBug severity.Low original: LWachtel1/ped#8

annoy-o-mus commented 7 months ago

One area to fix is in the JSON exporting, where if there are other commands relying on the export but still passes in infinity value due to them not being handled, then the JSONExport should catch it and drop the entry from saving

The other area to fix is in the way the add (and modify) command handles the user's input of large numbers (they are indicated as infinity. The suggestion is that the Medication setters validate those fields and not allow creation of any entries that has the value of infinity.

annoy-o-mus commented 7 months ago