1
0
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:
Darien Raymond
2017-04-09 15:04:04 +02:00
parent 0e01e9e9ca
commit 68bc9ea8e4
24 changed files with 78 additions and 78 deletions

View File

@@ -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)
}