From e7aaba0c306f8ca30c493b3f3d178f385dc11b0f Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Tue, 25 Jul 2017 23:12:54 +0200 Subject: [PATCH] refactor --- app/proxyman/inbound/worker.go | 2 +- proxy/handler_cache.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/proxyman/inbound/worker.go b/app/proxyman/inbound/worker.go index 4cd26fe26..de7308dd1 100644 --- a/app/proxyman/inbound/worker.go +++ b/app/proxyman/inbound/worker.go @@ -79,7 +79,7 @@ func (w *tcpWorker) Start() error { conns := make(chan internet.Connection, 16) hub, err := internet.ListenTCP(ctx, w.address, w.port, conns) if err != nil { - return err + return newError("failed to listen TCP on ", w.port).Base(err) } go w.handleConnections(conns) w.hub = hub diff --git a/proxy/handler_cache.go b/proxy/handler_cache.go index 976dabc7b..0d580a720 100644 --- a/proxy/handler_cache.go +++ b/proxy/handler_cache.go @@ -9,7 +9,7 @@ import ( func CreateInboundHandler(ctx context.Context, config interface{}) (Inbound, error) { handler, err := common.CreateObject(ctx, config) if err != nil { - return nil, err + return nil, newError("failed to create inbound handler").Base(err) } switch h := handler.(type) { case Inbound: @@ -22,7 +22,7 @@ func CreateInboundHandler(ctx context.Context, config interface{}) (Inbound, err func CreateOutboundHandler(ctx context.Context, config interface{}) (Outbound, error) { handler, err := common.CreateObject(ctx, config) if err != nil { - return nil, err + return nil, newError("failed to create outbound handler").Base(err) } switch h := handler.(type) { case Outbound: