Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: bcmmbaga <[email protected]>
  • Loading branch information
bcmmbaga committed Nov 19, 2024
1 parent 20fc8e8 commit 0ee56e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions management/server/sql_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ func (s *SqlStore) GetPeerByPeerPubKey(ctx context.Context, lockStrength Locking
result := s.db.Clauses(clause.Locking{Strength: string(lockStrength)}).First(&peer, keyQueryCondition, peerKey)
if result.Error != nil {
if errors.Is(result.Error, gorm.ErrRecordNotFound) {
return nil, status.Errorf(status.NotFound, "peer not found")
return nil, status.NewPeerNotFoundError(peerKey)
}
return nil, status.Errorf(status.Internal, "issue getting peer from store: %s", result.Error)
}
Expand Down Expand Up @@ -1121,7 +1121,7 @@ func (s *SqlStore) GetPeerByID(ctx context.Context, lockStrength LockingStrength
First(&peer, accountAndIDQueryCondition, accountID, peerID)
if result.Error != nil {
if errors.Is(result.Error, gorm.ErrRecordNotFound) {
return nil, status.Errorf(status.NotFound, "peer not found")
return nil, status.NewPeerNotFoundError(peerID)
}
log.WithContext(ctx).Errorf("failed to get peer from store: %s", result.Error)
return nil, status.Errorf(status.Internal, "failed to get peer from store")
Expand Down Expand Up @@ -1203,7 +1203,7 @@ func (s *SqlStore) DeletePeer(ctx context.Context, lockStrength LockingStrength,
}

if result.RowsAffected == 0 {
return status.Errorf(status.NotFound, "peer not found")
return status.NewPeerNotFoundError(peerID)
}

return nil
Expand Down

0 comments on commit 0ee56e1

Please sign in to comment.