mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-26 20:16:55 -05:00
fix error usage
This commit is contained in:
parent
fbfbbb8841
commit
14176a340d
@ -31,8 +31,7 @@ func (a *InternalAccount) Equals(account protocol.Account) bool {
|
|||||||
func (a *Account) AsAccount() (protocol.Account, error) {
|
func (a *Account) AsAccount() (protocol.Account, error) {
|
||||||
id, err := uuid.ParseString(a.Id)
|
id, err := uuid.ParseString(a.Id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
newError("failed to parse ID").Base(err).AtError().WriteToLog()
|
return nil, newError("failed to parse ID").Base(err).AtError()
|
||||||
return nil, err
|
|
||||||
}
|
}
|
||||||
protoID := protocol.NewID(id)
|
protoID := protocol.NewID(id)
|
||||||
return &InternalAccount{
|
return &InternalAccount{
|
||||||
|
@ -185,7 +185,7 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection i
|
|||||||
Status: log.AccessRejected,
|
Status: log.AccessRejected,
|
||||||
Reason: err,
|
Reason: err,
|
||||||
})
|
})
|
||||||
newError("invalid request from ", connection.RemoteAddr(), ": ", err).AtInfo().WriteToLog()
|
err = newError("invalid request from ", connection.RemoteAddr()).Base(err).AtInfo()
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -252,7 +252,7 @@ func (h *Handler) generateCommand(ctx context.Context, request *protocol.Request
|
|||||||
if h.inboundHandlerManager != nil {
|
if h.inboundHandlerManager != nil {
|
||||||
handler, err := h.inboundHandlerManager.GetHandler(ctx, tag)
|
handler, err := h.inboundHandlerManager.GetHandler(ctx, tag)
|
||||||
if err != nil {
|
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
|
return nil
|
||||||
}
|
}
|
||||||
proxyHandler, port, availableMin := handler.GetRandomInboundProxy()
|
proxyHandler, port, availableMin := handler.GetRandomInboundProxy()
|
||||||
|
Loading…
Reference in New Issue
Block a user