Skip to content

Commit

Permalink
BAARC-127: Log error only if error is unequal nil
Browse files Browse the repository at this point in the history
  • Loading branch information
boecklim committed Mar 25, 2024
1 parent ad111d3 commit c34c59e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,9 @@ func (p *Peer) versionMessage(address string) *wire.MsgVersion {

if p.userAgentName != nil && p.userAgentVersion != nil {
err = msg.AddUserAgent(*p.userAgentName, *p.userAgentVersion)
p.logger.Error("Failed to add user agent", slog.String(errKey, err.Error()))
if err != nil {
p.logger.Error("Failed to add user agent", slog.String(errKey, err.Error()))
}
}

return msg
Expand Down

0 comments on commit c34c59e

Please sign in to comment.