diff options
author | Felix Lange <fjl@twurst.com> | 2015-05-07 04:58:03 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2015-05-07 04:58:03 +0800 |
commit | fd4b75cfa8e1b5de9eba9ea4dc89cfe3bb291a91 (patch) | |
tree | 02aa41fc37989a36551828c297b6e77265e5ff32 /p2p/nat/nat.go | |
parent | 24d44f35f2cf17b07330a7e7be79abc2b6b92fc6 (diff) | |
download | dexon-fd4b75cfa8e1b5de9eba9ea4dc89cfe3bb291a91.tar dexon-fd4b75cfa8e1b5de9eba9ea4dc89cfe3bb291a91.tar.gz dexon-fd4b75cfa8e1b5de9eba9ea4dc89cfe3bb291a91.tar.bz2 dexon-fd4b75cfa8e1b5de9eba9ea4dc89cfe3bb291a91.tar.lz dexon-fd4b75cfa8e1b5de9eba9ea4dc89cfe3bb291a91.tar.xz dexon-fd4b75cfa8e1b5de9eba9ea4dc89cfe3bb291a91.tar.zst dexon-fd4b75cfa8e1b5de9eba9ea4dc89cfe3bb291a91.zip |
p2p/nat: less confusing error logging
Diffstat (limited to 'p2p/nat/nat.go')
-rw-r--r-- | p2p/nat/nat.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/p2p/nat/nat.go b/p2p/nat/nat.go index 4ae7e6b17..fe00bdab0 100644 --- a/p2p/nat/nat.go +++ b/p2p/nat/nat.go @@ -91,7 +91,8 @@ func Map(m Interface, c chan struct{}, protocol string, extport, intport int, na }() glog.V(logger.Debug).Infof("add mapping: %s %d -> %d (%s) using %s\n", protocol, extport, intport, name, m) if err := m.AddMapping(protocol, intport, extport, name, mapTimeout); err != nil { - glog.V(logger.Error).Infof("mapping error: %v\n", err) + glog.V(logger.Warn).Infof("network port %d could not be mapped: %v\n", intport, err) + glog.V(logger.Debug).Infof("mapping with %v returned %v\n", m, err) } for { select { @@ -102,7 +103,8 @@ func Map(m Interface, c chan struct{}, protocol string, extport, intport int, na case <-refresh.C: glog.V(logger.Detail).Infof("refresh mapping: %s %d -> %d (%s) using %s\n", protocol, extport, intport, name, m) if err := m.AddMapping(protocol, intport, extport, name, mapTimeout); err != nil { - glog.V(logger.Error).Infof("mapping error: %v\n", err) + glog.V(logger.Warn).Infof("network port %d could not be mapped: %v\n", intport, err) + glog.V(logger.Debug).Infof("mapping with %v returned %v\n", m, err) } refresh.Reset(mapUpdateInterval) } @@ -225,7 +227,7 @@ func (n *autodisc) wait() error { return nil } if found = <-n.done; found == nil { - return errors.New("no devices discovered") + return errors.New("no UPnP or NAT-PMP router discovered") } n.mu.Lock() n.found = found |