1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-25 11:35:34 -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

@@ -2,12 +2,11 @@ package loader
import (
"errors"
"github.com/v2ray/v2ray-core/common"
)
var (
ErrConfigIDKeyNotFound = errors.New("Config ID key is not found.")
ErrConfigIDExists = errors.New("Config ID already exists.")
ErrUnknownConfigID = errors.New("Unknown config ID.")
ErrUnknownConfigID = errors.New("Unknown config ID.")
)
type ConfigCreator func() interface{}
@@ -31,7 +30,7 @@ func NewBaseConfigLoader() *BaseConfigLoader {
func (this *BaseConfigLoader) RegisterCreator(id string, creator ConfigCreator) error {
if _, found := this.creators[id]; found {
return ErrConfigIDExists
return common.ErrDuplicatedName
}
this.creators[id] = creator