Skip to content

Commit

Permalink
#90 Fixed error message for key mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
glothriel committed Feb 12, 2025
1 parent 692cc24 commit f5a84a1
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions pkg/pairing/server.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package pairing

import (
"errors"
"fmt"

"github.com/glothriel/wormhole/pkg/wg"
Expand Down Expand Up @@ -62,13 +61,11 @@ func (s *Server) Start() { // nolint: funlen, gocognit
}
} else {
if existingPeer.PublicKey != request.Wireguard.PublicKey {

Check failure on line 63 in pkg/pairing/server.go

View workflow job for this annotation

GitHub Actions / lint

unnecessary leading newline (whitespace)
logrus.Errorf(
"attempted peering from peer `%s`: error, public key mismatch. "+

incomingRequest.Err <- NewClientError(
fmt.Errorf("attempted peering from peer `%s`: error, public key mismatch. "+
"There's existing peer `%s` with a different public key.",
request.Name, existingPeer.Name,
)
incomingRequest.Err <- NewServerError(
errors.New("please see the server log for error details"),
request.Name, existingPeer.Name),
)
continue
}
Expand Down

0 comments on commit f5a84a1

Please sign in to comment.