Skip to content

Commit

Permalink
ErrNoNATFound prints all internal errors
Browse files Browse the repository at this point in the history
  • Loading branch information
aschmahmann committed Jan 24, 2025
1 parent 35088ba commit df6eca8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion p2p/net/nat/internal/nat/nat.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"math"
"math/rand"
"net"
"strings"
"sync"
"time"

Expand All @@ -25,7 +26,11 @@ type ErrNoNATFound struct {
}

func (e ErrNoNATFound) Error() string {
return fmt.Sprintf("no NAT found: %#v", e.Errs)
var errStrs []string
for _, err := range e.Errs {
errStrs = append(errStrs, err.Error())
}
return fmt.Sprintf("no NAT found: [%s]", strings.Join(errStrs, "; "))
}

// protocol is either "udp" or "tcp"
Expand Down

0 comments on commit df6eca8

Please sign in to comment.