1
0
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:
Darien Raymond
2017-04-09 01:43:25 +02:00
parent 8175a751db
commit 35248497d2
141 changed files with 710 additions and 481 deletions

View File

@@ -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