Skip to content

Commit

Permalink
applying post PR merge feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanj-square committed Jul 10, 2024
1 parent a4e4b96 commit f387588
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/rpc/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"net"
"net/http"
"strings"
"syscall"
"time"

"connectrpc.com/connect"
Expand Down Expand Up @@ -269,10 +270,9 @@ func RetryStreamingServerStream[Req, Resp any](
}
}

// useDebugErrorLevel indicates whether the specified error should be reported as a debug
// level log.
// logLevelForError indicates the log.Level to use for the specified error
func logLevelForError(err error) log.Level {
if err != nil && strings.Contains(err.Error(), "connect: connection refused") {
if err != nil && errors.Is(err, syscall.ECONNREFUSED) {
return log.Debug
}
return log.Warn
Expand Down

0 comments on commit f387588

Please sign in to comment.