From e3e96a87fa795bbefa67a218017e626d665d587c Mon Sep 17 00:00:00 2001 From: Louis Ruch Date: Tue, 9 Mar 2021 08:28:33 -0800 Subject: [PATCH] Fix error codes --- internal/auth/password/repository_password.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/auth/password/repository_password.go b/internal/auth/password/repository_password.go index 0e897fa2d9..74ec6a6ccb 100644 --- a/internal/auth/password/repository_password.go +++ b/internal/auth/password/repository_password.go @@ -184,7 +184,7 @@ func (r *Repository) ChangePassword(ctx context.Context, scopeId, accountId, old return errors.Wrap(err, op, errors.WithMsg("unable to update account version")) } if rowsUpdated != 1 { - return errors.New(db.NoRowsAffected, op, fmt.Sprintf("updated account and %d rows updated", rowsUpdated)) + return errors.New(errors.MultipleRecords, op, fmt.Sprintf("updated account and %d rows updated", rowsUpdated)) } rowsDeleted, err := w.Delete(ctx, oldCred, db.WithOplog(oplogWrapper, oldCred.oplog(oplog.OpType_OP_TYPE_DELETE))) @@ -310,7 +310,7 @@ func (r *Repository) SetPassword(ctx context.Context, scopeId, accountId, passwo return errors.Wrap(err, op, errors.WithMsg("unable to update account version")) } if rowsUpdated != 1 { - return errors.New(db.NoRowsAffected, op, fmt.Sprintf("updated account and %d rows updated", rowsUpdated)) + return errors.New(errors.MultipleRecords, op, fmt.Sprintf("updated account and %d rows updated", rowsUpdated)) } acct = updatedAccount