1
0
Forkuj 0
kopia lustrzana https://github.com/XTLS/Xray-core.git zsynchronizowano 2025-07-11 04:24:15 +00:00

Errors: Add PrintRemovedFeatureError & PrintDeprecatedFeatureWarning (#3804)

Ten commit jest zawarty w:
Kobe Arthur Scofield 2024-09-15 12:55:54 +08:00 zatwierdzone przez GitHub
rodzic 3fed0c773f
commit 5f0642a671
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
8 zmienionych plików z 32 dodań i 25 usunięć

Wyświetl plik

@ -15,7 +15,6 @@ import (
"github.com/xtls/xray-core/common/net"
"github.com/xtls/xray-core/common/session"
"github.com/xtls/xray-core/common/strmatcher"
"github.com/xtls/xray-core/features"
"github.com/xtls/xray-core/features/dns"
)
@ -96,7 +95,7 @@ func New(ctx context.Context, config *Config) (*DNS, error) {
geoipContainer := router.GeoIPMatcherContainer{}
for _, endpoint := range config.NameServers {
features.PrintDeprecatedFeatureWarning("simple DNS server")
errors.PrintDeprecatedFeatureWarning("simple DNS server", "")
client, err := NewSimpleClient(ctx, endpoint, clientIP)
if err != nil {
return nil, errors.New("failed to create client").Base(err)

Wyświetl plik

@ -7,7 +7,6 @@ import (
"github.com/xtls/xray-core/common/errors"
"github.com/xtls/xray-core/common/net"
"github.com/xtls/xray-core/common/strmatcher"
"github.com/xtls/xray-core/features"
"github.com/xtls/xray-core/features/dns"
)
@ -26,7 +25,7 @@ func NewStaticHosts(hosts []*Config_HostMapping, legacy map[string]*net.IPOrDoma
}
if legacy != nil {
features.PrintDeprecatedFeatureWarning("simple host mapping")
errors.PrintDeprecatedFeatureWarning("simple host mapping", "")
for domain, ip := range legacy {
matcher, err := strmatcher.Full.New(domain)