diff options
author | a1012112796 <1012112796@qq.com> | 2021-04-10 14:12:38 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-10 07:12:38 +0100 |
commit | e375cbfd464e12a704c3c1325315a0381ab877a7 (patch) | |
tree | 93d0769ac68625a5a365a821b1a4bf9aa3470bac /models/error.go | |
parent | 9a0858cecf3518c9c5808bc2aeaa99278fd86cd0 (diff) | |
download | gitea-e375cbfd464e12a704c3c1325315a0381ab877a7.tar.gz gitea-e375cbfd464e12a704c3c1325315a0381ab877a7.zip |
rsponse 404 when delete not exist email (#15383)
fix #15357
Signed-off-by: a1012112796 <1012112796@qq.com>
Diffstat (limited to 'models/error.go')
-rw-r--r-- | models/error.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/models/error.go b/models/error.go index 6e110f94d7..48cba57a81 100644 --- a/models/error.go +++ b/models/error.go @@ -222,6 +222,21 @@ func (err ErrEmailInvalid) Error() string { return fmt.Sprintf("e-mail invalid [email: %s]", err.Email) } +// ErrEmailAddressNotExist email address not exist +type ErrEmailAddressNotExist struct { + Email string +} + +// IsErrEmailAddressNotExist checks if an error is an ErrEmailAddressNotExist +func IsErrEmailAddressNotExist(err error) bool { + _, ok := err.(ErrEmailAddressNotExist) + return ok +} + +func (err ErrEmailAddressNotExist) Error() string { + return fmt.Sprintf("Email address does not exist [email: %s]", err.Email) +} + // ErrOpenIDAlreadyUsed represents a "OpenIDAlreadyUsed" kind of error. type ErrOpenIDAlreadyUsed struct { OpenID string |