mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-12-31 22:45:39 -05:00
cleanup error messages
This commit is contained in:
@@ -16,7 +16,7 @@ var (
|
||||
func RegisterConfig(config interface{}, configCreator ConfigCreator) error {
|
||||
configType := reflect.TypeOf(config)
|
||||
if _, found := typeCreatorRegistry[configType]; found {
|
||||
return newError("Common: " + configType.Name() + " is already registered.")
|
||||
return newError(configType.Name() + " is already registered").AtError()
|
||||
}
|
||||
typeCreatorRegistry[configType] = configCreator
|
||||
return nil
|
||||
@@ -27,7 +27,7 @@ func CreateObject(ctx context.Context, config interface{}) (interface{}, error)
|
||||
configType := reflect.TypeOf(config)
|
||||
creator, found := typeCreatorRegistry[configType]
|
||||
if !found {
|
||||
return nil, newError("Common: " + configType.String() + " is not registered.")
|
||||
return nil, newError(configType.String() + " is not registered").AtError()
|
||||
}
|
||||
return creator(ctx, config)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user