Chore: Handle wrapped errors (#29223)

* Chore: Handle wrapped errors

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
This commit is contained in:
Arve Knudsen
2020-11-19 13:34:28 +01:00
committed by GitHub
parent 0cb29d337a
commit 294770f411
34 changed files with 153 additions and 124 deletions

View File

@@ -131,7 +131,7 @@ func verifyUserSignUpEmail(email string, code string) (bool, Response) {
query := models.GetTempUserByCodeQuery{Code: code}
if err := bus.Dispatch(&query); err != nil {
if err == models.ErrTempUserNotFound {
if errors.Is(err, models.ErrTempUserNotFound) {
return false, Error(404, "Invalid email verification code", nil)
}
return false, Error(500, "Failed to read temp user", err)