Skip to content

Commit

Permalink
rpcserver: format rpcLog error
Browse files Browse the repository at this point in the history
We were using `Error(<string>, <err>)` instead of `Errorf(<string>,
<err>)`. The error was appended at the end of the message instead of
replacing the `%v` tag in the message.
  • Loading branch information
positiveblue committed Dec 29, 2022
1 parent 59e0fd7 commit 3f7eac8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,9 @@ func (s *rpcServer) Stop() error {
}

// serverHandler is the main event loop of the server.
func (s *rpcServer) serverHandler(blockChan chan int32, blockErrChan chan error) {
func (s *rpcServer) serverHandler(blockChan chan int32,
blockErrChan chan error) {

defer s.wg.Done()

for {
Expand Down Expand Up @@ -275,7 +277,7 @@ func (s *rpcServer) serverHandler(blockChan chan int32, blockErrChan chan error)
}
}

rpcLog.Error("Unknown server error: %v", err)
rpcLog.Errorf("Unknown server error: %v", err)

case height := <-blockChan:
rpcLog.Infof("Received new block notification: "+
Expand Down

0 comments on commit 3f7eac8

Please sign in to comment.