3 ms·
Why would you send a blank error message? Surely you would at least send “Unknown error”.
by earthboundkid 6y ago
Why would you send a blank error message? Surely you would at least send “Unknown error”.
- lmm 6y agoYou probably wouldn't send "hlcrkorluatnsuh" either. But using that to represent "no error" would still be a bad idea.
- earthboundkid 6y agoI don’t understand what the structure you’re proposing is. There are a lot of ways of doing form validation. Typically you’ll have field levels errors and form level errors. In those cases, the no error state is represented by an empty list. I have never seen errors represented in a way that null means no error but blank string means unknown error. That would be a weird way to represent it.
- earthboundkid 6y agoIncidentally, the JS DOM represents no error on an input element as a blank string, not null: https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/setCustomValidity https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectE...