mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-29 23:34:44 +00:00
refine error messages
This commit is contained in:
18 files changed
+128
-167
No files matched your search
+3
-3
@@ -4,9 +4,9 @@ import (
|
||||
"io"
|
||||
"io/ioutil"
|
||||
|
||||
"v2ray.com/core/common"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
|
||||
"v2ray.com/core/common/errors"
|
||||
)
|
||||
|
||||
type ConfigLoader func(input io.Reader) (*Config, error)
|
||||
@@ -21,7 +21,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, common.ErrBadConfiguration
|
||||
return nil, errors.New("Core: ", ConfigFormat_name[int32(format)], " is not loadable.")
|
||||
}
|
||||
return loader(input)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user