Skip to content
Snippets Groups Projects
Commit a1ac2dba authored by Christel Loftus's avatar Christel Loftus
Browse files

#1959 - Email validation error response

parent a457f019
No related branches found
No related tags found
Loading
......@@ -96,8 +96,11 @@ func ValidateEmailAddress(email string, options ...map[string]string) (string, e
}
} else {
result, err := verifier.Verify(cleanedEmail)
if err != nil || !result.Syntax.Valid {
return cleanedEmail, errors.Wrap(err, "could not parse email address")
if err != nil {
return cleanedEmail, err
}
if !result.Syntax.Valid {
return cleanedEmail, errors.Error("email address has invalid syntax")
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment