merge bad configuration error

This commit is contained in:
v2ray committed 2016-08-18 08:21:20 +02:00
1 parent 933e244d92
commit 39737f6fc1
10 files changed
+25 -27

No files matched your search

+3 -2
View File
@@ -7,6 +7,7 @@ import (
"errors"
"strings"
"github.com/v2ray/v2ray-core/common"
"github.com/v2ray/v2ray-core/common/log"
"github.com/v2ray/v2ray-core/common/protocol"
"github.com/v2ray/v2ray-core/proxy/registry"
@@ -46,12 +47,12 @@ func (this *Config) UnmarshalJSON(data []byte) error {
}
default:
log.Error("Shadowsocks: Unknown cipher method: ", jsonConfig.Cipher)
return registry.ErrBadConfiguration
return common.ErrBadConfiguration
}
if len(jsonConfig.Password) == 0 {
log.Error("Shadowsocks: Password is not specified.")
return registry.ErrBadConfiguration
return common.ErrBadConfiguration
}
this.Key = PasswordToCipherKey(jsonConfig.Password, this.Cipher.KeySize())