After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 782622 - error handling for ingredients adding
error handling for ingredients adding
Status: RESOLVED FIXED
Product: recipes
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Recipes maintainer(s)
Recipes maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2017-05-14 15:13 UTC by Matthias Clasen
Modified: 2017-05-14 16:20 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Matthias Clasen 2017-05-14 15:13:21 UTC
We don't do a good enough job with detecting errors in the ingredients row fields. For example, if you mix up the entries and put the ingredient where the amount is supposed to go, we silently show:

Mayonnaise | 10 g

in the edit page, but when you save the recipe, this line gets dropped, almost silently. We do say "Failed to parse Mayonnaise as a number" on the console, but that is not useful. Instead, we should parse the amount as soon as it gets added, and flag obvious nonsense as errors on the edit page. 

The tricky part is to decide what we consider 'obvious nonsense', since we probably do want continue allowing unknown units, since there is a lot of variation in unit naming. E.g:

"2 bottles"

should probably be allowed, even though we don't know the unit "bottle" per se. And we also need to allow unitless numbers.