1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-27 12:35:21 -05:00

merge similar error definitions

This commit is contained in:
v2ray
2016-08-18 08:34:21 +02:00
parent 786775ea80
commit ad1353ac2f
8 changed files with 27 additions and 30 deletions

View File

@@ -3,6 +3,7 @@ package testing
import (
"fmt"
"github.com/v2ray/v2ray-core/common"
"github.com/v2ray/v2ray-core/proxy/registry"
)
@@ -17,7 +18,7 @@ func RegisterInboundConnectionHandlerCreator(prefix string, creator registry.Inb
for {
name := prefix + randomString()
err := registry.RegisterInboundHandlerCreator(name, creator)
if err != registry.ErrNameExists {
if err != common.ErrDuplicatedName {
return name, err
}
}
@@ -27,7 +28,7 @@ func RegisterOutboundConnectionHandlerCreator(prefix string, creator registry.Ou
for {
name := prefix + randomString()
err := registry.RegisterOutboundHandlerCreator(name, creator)
if err != registry.ErrNameExists {
if err != common.ErrDuplicatedName {
return name, err
}
}