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

rename errors

This commit is contained in:
v2ray
2016-08-07 15:32:41 +02:00
parent 75b8dd9521
commit 545fa5b53c
5 changed files with 14 additions and 14 deletions

View File

@@ -80,7 +80,7 @@ var (
func LoadConfig(init string) (*Config, error) {
if configLoader == nil {
return nil, ErrorBadConfiguration
return nil, ErrBadConfiguration
}
return configLoader(init)
}

View File

@@ -193,7 +193,7 @@ func (this *InboundDetourConfig) UnmarshalJSON(data []byte) error {
}
if jsonConfig.PortRange == nil {
log.Error("Point: Port range not specified in InboundDetour.")
return ErrorBadConfiguration
return ErrBadConfiguration
}
this.ListenOn = v2net.AnyIP
if jsonConfig.ListenOn != nil {

View File

@@ -5,5 +5,5 @@ import (
)
var (
ErrorBadConfiguration = errors.New("Bad configuration.")
ErrBadConfiguration = errors.New("Bad configuration.")
)

View File

@@ -82,7 +82,7 @@ func NewPoint(pConfig *Config) (*Point, error) {
r, err := router.CreateRouter(routerConfig.Strategy, routerConfig.Settings, vpoint.space)
if err != nil {
log.Error("Failed to create router: ", err)
return nil, ErrorBadConfiguration
return nil, ErrBadConfiguration
}
vpoint.space.BindApp(router.APP_ID, r)
vpoint.router = r
@@ -129,19 +129,19 @@ func NewPoint(pConfig *Config) (*Point, error) {
dh, err := NewInboundDetourHandlerAlways(vpoint.space, detourConfig)
if err != nil {
log.Error("Point: Failed to create detour handler: ", err)
return nil, ErrorBadConfiguration
return nil, ErrBadConfiguration
}
detourHandler = dh
case AllocationStrategyRandom:
dh, err := NewInboundDetourHandlerDynamic(vpoint.space, detourConfig)
if err != nil {
log.Error("Point: Failed to create detour handler: ", err)
return nil, ErrorBadConfiguration
return nil, ErrBadConfiguration
}
detourHandler = dh
default:
log.Error("Point: Unknown allocation strategy: ", allocConfig.Strategy)
return nil, ErrorBadConfiguration
return nil, ErrBadConfiguration
}
vpoint.idh[idx] = detourHandler
if len(detourConfig.Tag) > 0 {
@@ -188,7 +188,7 @@ func (this *Point) Close() {
func (this *Point) Start() error {
if this.port <= 0 {
log.Error("Point: Invalid port ", this.port)
return ErrorBadConfiguration
return ErrBadConfiguration
}
err := retry.Timed(100 /* times */, 100 /* ms */).On(func() error {