mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 17:38:41 +00:00
Errors: Add PrintRemovedFeatureError & PrintDeprecatedFeatureWarning (#3804)
This commit is contained in:
parent
3fed0c773f
commit
5f0642a671
8 changed files with 32 additions and 25 deletions
|
@ -813,7 +813,7 @@ func (c *StreamConfig) Build() (*internet.StreamConfig, error) {
|
|||
config.SecuritySettings = append(config.SecuritySettings, tm)
|
||||
config.SecurityType = tm.Type
|
||||
case "xtls":
|
||||
return nil, errors.New(`Please use VLESS flow "xtls-rprx-vision" with TLS or REALITY.`)
|
||||
return nil, errors.PrintRemovedFeatureError(`Legacy XTLS`, `xtls-rprx-vision with TLS or REALITY`)
|
||||
default:
|
||||
return nil, errors.New(`Unknown security "` + c.Security + `".`)
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ func (c *TrojanClientConfig) Build() (proto.Message, error) {
|
|||
return nil, errors.New("Trojan password is not specified.")
|
||||
}
|
||||
if rec.Flow != "" {
|
||||
return nil, errors.New(`Trojan doesn't support "flow" anymore.`)
|
||||
return nil, errors.PrintRemovedFeatureError(`Flow for Trojan`, ``)
|
||||
}
|
||||
|
||||
config.Server[idx] = &protocol.ServerEndpoint{
|
||||
|
@ -106,7 +106,7 @@ func (c *TrojanServerConfig) Build() (proto.Message, error) {
|
|||
|
||||
for idx, rawUser := range c.Clients {
|
||||
if rawUser.Flow != "" {
|
||||
return nil, errors.New(`Trojan doesn't support "flow" anymore.`)
|
||||
return nil, errors.PrintRemovedFeatureError(`Flow for Trojan`, ``)
|
||||
}
|
||||
|
||||
config.Users[idx] = &protocol.User{
|
||||
|
|
|
@ -593,7 +593,7 @@ func (c *Config) Build() (*core.Config, error) {
|
|||
}
|
||||
|
||||
if len(c.Transport) > 0 {
|
||||
return nil, errors.New("Global transport config is deprecated")
|
||||
return nil, errors.PrintRemovedFeatureError("Global transport config", "streamSettings in inbounds and outbounds")
|
||||
}
|
||||
|
||||
for _, rawInboundConfig := range inbounds {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue