Handle email validation error from server

This commit is contained in:
Eric Bailey
2025-07-09 20:49:27 -05:00
parent a8eba7552b
commit 61e1c68344
2 changed files with 16 additions and 3 deletions
@@ -114,8 +114,21 @@ function Inner() {
setSuccess(true)
} catch (e) {
const {clean} = cleanError(e)
setError(clean || _(msg`Something went wrong, please try again`))
const {clean, raw} = cleanError(e)
if (clean) {
setError(clean || _(msg`Something went wrong, please try again`))
} else {
let message = _(msg`Something went wrong, please try again`)
if (raw) {
if (raw.startsWith('This email address is not supported')) {
message = _(msg`Please enter a valid, non-temporary email address.`)
}
}
setError(message)
}
}
}