Skip to content

Commit

Permalink
Change error to use errors.New when there is no formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacalz committed May 29, 2024
1 parent 060a2e9 commit 44c748a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions rendezvous/rendezvousservertest/rendezvousservertest.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,13 @@ func (ts *TestServer) handleWS(w http.ResponseWriter, r *http.Request) {
case *msgs.Bind:
if sideID != "" {
ackMsg(m.ID)
errMsg(m.ID, m, fmt.Errorf("already bound"))
errMsg(m.ID, m, errors.New("already bound"))
continue
}

if m.Side == "" {
ackMsg(m.ID)
errMsg(m.ID, m, fmt.Errorf("bind requires 'side'"))
errMsg(m.ID, m, errors.New("bind requires 'side'"))
continue
}

Expand Down Expand Up @@ -287,7 +287,7 @@ func (ts *TestServer) handleWS(w http.ResponseWriter, r *http.Request) {
ts.mu.Unlock()

if nameplate < 1 {
errMsg(m.ID, m, fmt.Errorf("failed to allocate nameplate"))
errMsg(m.ID, m, errors.New("failed to allocate nameplate"))
continue
}

Expand Down
4 changes: 2 additions & 2 deletions wormhole/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func (c *Client) SendText(ctx context.Context, msg string, opts ...SendOption) (
close(ch)
return
} else {
sendErr(fmt.Errorf("unexpected answer"))
sendErr(errors.New("unexpected answer"))
return
}
}()
Expand Down Expand Up @@ -346,7 +346,7 @@ func (c *Client) sendFileDirectory(ctx context.Context, offer *offerMsg, r io.Re
}

if answer.FileAck != "ok" {
sendErr(fmt.Errorf("unexpected answer"))
sendErr(errors.New("unexpected answer"))
return
}

Expand Down

0 comments on commit 44c748a

Please sign in to comment.