1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-06-06 11:09:21 -04:00

refactor error interface

This commit is contained in:
Darien Raymond
2017-04-06 15:13:09 +02:00
parent 65c6972eb5
commit fc31f9b94c
40 changed files with 272 additions and 249 deletions

View File

@@ -102,7 +102,7 @@ func (v *Handler) Process(ctx context.Context, outboundRay ray.OutboundRay, dial
return nil
})
if err != nil {
return errors.Base(err).Message("Freedom: Failed to open connection to ", destination)
return errors.New("failed to open connection to ", destination).Base(err).Path("Freedom")
}
defer conn.Close()
@@ -136,7 +136,7 @@ func (v *Handler) Process(ctx context.Context, outboundRay ray.OutboundRay, dial
if err := signal.ErrorOrFinish2(ctx, requestDone, responseDone); err != nil {
input.CloseError()
output.CloseError()
return errors.Base(err).Message("Freedom: Connection ends.")
return errors.New("connection ends").Base(err).Path("Freedom")
}
runtime.KeepAlive(timer)