diff options
| author | Loyalsoldier <[email protected]> | 2024-08-31 12:34:38 +0800 |
|---|---|---|
| committer | Loyalsoldier <[email protected]> | 2024-08-31 12:34:38 +0800 |
| commit | 1e4cb746b9ca67b9d9dabdc65f42f495eb4cfbcd (patch) | |
| tree | ee3de1a60416c7f56dcc99a2cf7715b9b8f4e5a2 /plugin/special | |
| parent | deff06ac0f59751bb9857bc7d645b756b6133ddf (diff) | |
Chore: make error messages consistent across formats
Diffstat (limited to 'plugin/special')
| -rw-r--r-- | plugin/special/cutter.go | 4 | ||||
| -rw-r--r-- | plugin/special/lookup.go | 2 | ||||
| -rw-r--r-- | plugin/special/stdin.go | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/plugin/special/cutter.go b/plugin/special/cutter.go index 2d52e161..2b33ee27 100644 --- a/plugin/special/cutter.go +++ b/plugin/special/cutter.go @@ -35,7 +35,7 @@ func newCutter(action lib.Action, data json.RawMessage) (lib.InputConverter, err } if action != lib.ActionRemove { - return nil, fmt.Errorf("type %s only supports `remove` action", typeCutter) + return nil, fmt.Errorf("❌ [type %s] only supports `remove` action", typeCutter) } // Filter want list @@ -47,7 +47,7 @@ func newCutter(action lib.Action, data json.RawMessage) (lib.InputConverter, err } if len(wantList) == 0 { - return nil, fmt.Errorf("type %s wantedList must be specified", typeCutter) + return nil, fmt.Errorf("❌ [type %s] wantedList must be specified", typeCutter) } return &cutter{ diff --git a/plugin/special/lookup.go b/plugin/special/lookup.go index 7c97e746..34ba0207 100644 --- a/plugin/special/lookup.go +++ b/plugin/special/lookup.go @@ -38,7 +38,7 @@ func newLookup(action lib.Action, data json.RawMessage) (lib.OutputConverter, er tmp.Search = strings.TrimSpace(tmp.Search) if tmp.Search == "" { - return nil, fmt.Errorf("type %s | action %s: please specify an IP or a CIDR as search target", typeLookup, action) + return nil, fmt.Errorf("❌ [type %s | action %s] please specify an IP or a CIDR as search target", typeLookup, action) } return &lookup{ diff --git a/plugin/special/stdin.go b/plugin/special/stdin.go index 4f56d756..1621c351 100644 --- a/plugin/special/stdin.go +++ b/plugin/special/stdin.go @@ -37,7 +37,7 @@ func newStdin(action lib.Action, data json.RawMessage) (lib.InputConverter, erro } if tmp.Name == "" { - return nil, fmt.Errorf("type %s | action %s missing name", typeStdin, action) + return nil, fmt.Errorf("❌ [type %s | action %s] missing name", typeStdin, action) } return &stdin{ |
