Chore: more detailed error when dial failed

This commit is contained in:
gVisor bot 2020-11-20 00:27:37 +08:00
parent 00ecdf0afc
commit f0ecf5b8d4

View File

@ -218,7 +218,7 @@ func handleUDPConn(packet *inbound.PacketAdapter) {
rawPc, err := proxy.DialUDP(metadata) rawPc, err := proxy.DialUDP(metadata)
if err != nil { if err != nil {
log.Warnln("[UDP] dial %s error: %s", proxy.Name(), err.Error()) log.Warnln("[UDP] dial %s to %s error: %s", proxy.Name(), metadata.String(), err.Error())
return return
} }
pc := newUDPTracker(rawPc, DefaultManager, metadata, rule) pc := newUDPTracker(rawPc, DefaultManager, metadata, rule)
@ -257,13 +257,13 @@ func handleTCPConn(localConn C.ServerAdapter) {
proxy, rule, err := resolveMetadata(metadata) proxy, rule, err := resolveMetadata(metadata)
if err != nil { if err != nil {
log.Warnln("Parse metadata failed: %v", err) log.Warnln("[Metadata] parse failed: %s", err.Error())
return return
} }
remoteConn, err := proxy.Dial(metadata) remoteConn, err := proxy.Dial(metadata)
if err != nil { if err != nil {
log.Warnln("dial %s error: %s", proxy.Name(), err.Error()) log.Warnln("dial %s to %s error: %s", proxy.Name(), metadata.String(), err.Error())
return return
} }
remoteConn = newTCPTracker(remoteConn, DefaultManager, metadata, rule) remoteConn = newTCPTracker(remoteConn, DefaultManager, metadata, rule)