Skip to content

Commit

Permalink
fix: properly check for not found
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Feb 26, 2022
1 parent 299c6e3 commit 77ac199
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion selfservice/strategy/link/strategy_recovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 77ac199

Please sign in to comment.