From 1c760935f4e5f429cd23ecd2c3930003cb95e49b Mon Sep 17 00:00:00 2001 From: Dreamacro <305009791@qq.com> Date: Thu, 11 Jun 2020 22:07:20 +0800 Subject: [PATCH] Chore: add error msg when dial vmess --- adapters/outbound/vmess.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adapters/outbound/vmess.go b/adapters/outbound/vmess.go index 51ff044..023b1ce 100644 --- a/adapters/outbound/vmess.go +++ b/adapters/outbound/vmess.go @@ -108,7 +108,7 @@ func (v *Vmess) StreamConn(c net.Conn, metadata *C.Metadata) (net.Conn, error) { func (v *Vmess) DialContext(ctx context.Context, metadata *C.Metadata) (C.Conn, error) { c, err := dialer.DialContext(ctx, "tcp", v.addr) if err != nil { - return nil, fmt.Errorf("%s connect error", v.addr) + return nil, fmt.Errorf("%s connect error: %s", v.addr, err.Error()) } tcpKeepAlive(c) @@ -130,7 +130,7 @@ func (v *Vmess) DialUDP(metadata *C.Metadata) (C.PacketConn, error) { defer cancel() c, err := dialer.DialContext(ctx, "tcp", v.addr) if err != nil { - return nil, fmt.Errorf("%s connect error", v.addr) + return nil, fmt.Errorf("%s connect error: %s", v.addr, err.Error()) } tcpKeepAlive(c) c, err = v.StreamConn(c, metadata)