summaryrefslogtreecommitdiff
path: root/plugin/v2ray
diff options
context:
space:
mode:
authorLoyalsoldier <[email protected]>2024-08-31 12:34:38 +0800
committerLoyalsoldier <[email protected]>2024-08-31 12:34:38 +0800
commit1e4cb746b9ca67b9d9dabdc65f42f495eb4cfbcd (patch)
treeee3de1a60416c7f56dcc99a2cf7715b9b8f4e5a2 /plugin/v2ray
parentdeff06ac0f59751bb9857bc7d645b756b6133ddf (diff)
Chore: make error messages consistent across formats
Diffstat (limited to 'plugin/v2ray')
-rw-r--r--plugin/v2ray/dat_in.go6
-rw-r--r--plugin/v2ray/dat_out.go2
2 files changed, 4 insertions, 4 deletions
diff --git a/plugin/v2ray/dat_in.go b/plugin/v2ray/dat_in.go
index 4b2a98c0..96de3d70 100644
--- a/plugin/v2ray/dat_in.go
+++ b/plugin/v2ray/dat_in.go
@@ -42,7 +42,7 @@ func newGeoIPDatIn(action lib.Action, data json.RawMessage) (lib.InputConverter,
}
if tmp.URI == "" {
- return nil, fmt.Errorf("[type %s | action %s] uri must be specified in config", typeGeoIPdatIn, action)
+ return nil, fmt.Errorf("❌ [type %s | action %s] uri must be specified in config", typeGeoIPdatIn, action)
}
// Filter want list
@@ -100,7 +100,7 @@ func (g *geoIPDatIn) Input(container lib.Container) (lib.Container, error) {
}
if len(entries) == 0 {
- return nil, fmt.Errorf("❌ [type %s | action %s] no entry is generated", typeGeoIPdatIn, g.Action)
+ return nil, fmt.Errorf("❌ [type %s | action %s] no entry is generated", g.Type, g.Action)
}
var ignoreIPType lib.IgnoreIPOption
@@ -151,7 +151,7 @@ func (g *geoIPDatIn) walkRemoteFile(url string, entries map[string]*lib.Entry) e
defer resp.Body.Close()
if resp.StatusCode != 200 {
- return fmt.Errorf("failed to get remote file %s, http status code %d", url, resp.StatusCode)
+ return fmt.Errorf("❌ [type %s | action %s] failed to get remote file %s, http status code %d", g.Type, g.Action, url, resp.StatusCode)
}
if err := g.generateEntries(resp.Body, entries); err != nil {
diff --git a/plugin/v2ray/dat_out.go b/plugin/v2ray/dat_out.go
index abb00ca4..771d4e27 100644
--- a/plugin/v2ray/dat_out.go
+++ b/plugin/v2ray/dat_out.go
@@ -219,7 +219,7 @@ func (g *geoIPDatOut) generateGeoIP(entry *lib.Entry) (*router.GeoIP, error) {
}, nil
}
- return nil, fmt.Errorf("entry %s has no CIDR", entry.GetName())
+ return nil, fmt.Errorf("❌ [type %s | action %s] entry %s has no CIDR", g.Type, g.Action, entry.GetName())
}
// Sort by country code to make reproducible builds