Errors: Add PrintRemovedFeatureError & PrintDeprecatedFeatureWarning (#3804)

This commit is contained in:
Kobe Arthur Scofield 2024-09-15 12:55:54 +08:00 committed by GitHub
parent 3fed0c773f
commit 5f0642a671
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 32 additions and 25 deletions

View file

@ -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{