Chore: more detailed error when dial failed

This commit is contained in:
Dreamacro 2020-11-20 00:27:37 +08:00
parent 97581148b5
commit 34febc4579

View file

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