1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Don't panic on ErrEmailInvalid (#19441) (#19442)

- Backport #19441
  - Don't panic on `ErrEmailInvalid`, this was caused due that we were trying to force `ErrEmailCharIsNotSupported` interface, which panics.
  - Resolves #19397

Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
Gusted
2022-04-20 22:24:07 +00:00
committed by GitHub
parent a785c46ca8
commit 5863f7e048
2 changed files with 16 additions and 3 deletions

View File

@@ -69,6 +69,12 @@ func TestAPIAddEmail(t *testing.T) {
Primary: false,
},
}, emails)
opts = api.CreateEmailOption{
Emails: []string{"notAEmail"},
}
req = NewRequestWithJSON(t, "POST", "/api/v1/user/emails?token="+token, &opts)
session.MakeRequest(t, req, http.StatusUnprocessableEntity)
}
func TestAPIDeleteEmail(t *testing.T) {