GNOME Bugzilla – Bug 782622
error handling for ingredients adding
Last modified: 2017-05-14 16:20:35 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.