mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-01-06 01:05:35 -05:00
refactor error messages
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"context"
|
||||
"net"
|
||||
|
||||
"v2ray.com/core/common/errors"
|
||||
v2net "v2ray.com/core/common/net"
|
||||
)
|
||||
|
||||
@@ -53,7 +52,7 @@ func (v *RoutingRule) BuildCondition() (Condition, error) {
|
||||
}
|
||||
ipv6Cond.Add(matcher)
|
||||
default:
|
||||
return nil, errors.New("Router: Invalid IP length.")
|
||||
return nil, newError("Router: Invalid IP length.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,7 +93,7 @@ func (v *RoutingRule) BuildCondition() (Condition, error) {
|
||||
}
|
||||
ipv6Cond.Add(matcher)
|
||||
default:
|
||||
return nil, errors.New("Router: Invalid IP length.")
|
||||
return nil, newError("Router: Invalid IP length.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,7 +118,7 @@ func (v *RoutingRule) BuildCondition() (Condition, error) {
|
||||
}
|
||||
|
||||
if conds.Len() == 0 {
|
||||
return nil, errors.New("Router: This rule has no effective fields.")
|
||||
return nil, newError("Router: This rule has no effective fields.")
|
||||
}
|
||||
|
||||
return conds, nil
|
||||
|
||||
Reference in New Issue
Block a user