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

refactor error messages

This commit is contained in:
Darien Raymond
2017-04-09 01:43:25 +02:00
parent 8175a751db
commit 35248497d2
141 changed files with 710 additions and 481 deletions

View File

@@ -6,7 +6,6 @@ import (
"github.com/golang/protobuf/proto"
"v2ray.com/core/common"
"v2ray.com/core/common/errors"
)
// ConfigLoader is an utility to load V2Ray config from external source.
@@ -24,7 +23,7 @@ func RegisterConfigLoader(format ConfigFormat, loader ConfigLoader) error {
func LoadConfig(format ConfigFormat, input io.Reader) (*Config, error) {
loader, found := configLoaderCache[format]
if !found {
return nil, errors.New("Core: ", ConfigFormat_name[int32(format)], " is not loadable.")
return nil, newError("Core: ", ConfigFormat_name[int32(format)], " is not loadable.")
}
return loader(input)
}