1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-30 05:56:54 -05:00

fix error usage

This commit is contained in:
Darien Raymond 2018-01-18 11:35:04 +01:00
parent fbfbbb8841
commit 14176a340d
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
2 changed files with 3 additions and 4 deletions

View File

@ -31,8 +31,7 @@ func (a *InternalAccount) Equals(account protocol.Account) bool {
func (a *Account) AsAccount() (protocol.Account, error) {
id, err := uuid.ParseString(a.Id)
if err != nil {
newError("failed to parse ID").Base(err).AtError().WriteToLog()
return nil, err
return nil, newError("failed to parse ID").Base(err).AtError()
}
protoID := protocol.NewID(id)
return &InternalAccount{

View File

@ -185,7 +185,7 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection i
Status: log.AccessRejected,
Reason: err,
})
newError("invalid request from ", connection.RemoteAddr(), ": ", err).AtInfo().WriteToLog()
err = newError("invalid request from ", connection.RemoteAddr()).Base(err).AtInfo()
}
return err
}
@ -252,7 +252,7 @@ func (h *Handler) generateCommand(ctx context.Context, request *protocol.Request
if h.inboundHandlerManager != nil {
handler, err := h.inboundHandlerManager.GetHandler(ctx, tag)
if err != nil {
newError("failed to get detour handler: ", tag, err).AtWarning().WriteToLog()
newError("failed to get detour handler: ", tag).Base(err).AtWarning().WriteToLog()
return nil
}
proxyHandler, port, availableMin := handler.GetRandomInboundProxy()