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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user