From 77ac199f00f04eb7fd40db6fb546921271026e20 Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Fri, 25 Feb 2022 14:40:28 +0100 Subject: [PATCH] fix: properly check for not found --- selfservice/strategy/link/strategy_recovery.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfservice/strategy/link/strategy_recovery.go b/selfservice/strategy/link/strategy_recovery.go index 33ba3cd81887..6012dd2a61d6 100644 --- a/selfservice/strategy/link/strategy_recovery.go +++ b/selfservice/strategy/link/strategy_recovery.go @@ -159,7 +159,7 @@ func (s *Strategy) createRecoveryLink(w http.ResponseWriter, r *http.Request, _ } id, err := s.d.IdentityPool().GetIdentity(r.Context(), p.IdentityID) - if errors.Is(err, herodot.ErrNotFound) { + if errors.Is(err, sqlcon.ErrNoRows) { s.d.Writer().WriteError(w, r, errors.WithStack(herodot.ErrBadRequest.WithReasonf("The requested identity id does not exist.").WithWrap(err))) return } else if err != nil {