purescript-email-validate icon indicating copy to clipboard operation
purescript-email-validate copied to clipboard

Confusing error message for attempted email addresses like "foo@"

Open bbarker opened this issue 6 years ago • 1 comments

When attempting email addresses like foo@, this gives

Email validation error: Could not match character '['

Which is correctly marked as invalid but the message itself does not seem to be very useful.

bbarker avatar Jul 05 '19 20:07 bbarker

purescript-email-validate is mostly just a purescript rewrite of the Haskell library email-validate, warts and all.

This particular problem seems to come from email validate:

$ stack ghci --package email-validate
> import Text.Email.Validate
> :set -XOverloadedStrings
> validate "foo@"
Left "[: not enough input"

If you'd like to fix up the parser to give better error messages, I imagine a lot of people would find that useful.

cdepillabout avatar Jul 06 '19 03:07 cdepillabout