diff --git a/inputs/nginx_upstream_check/nginx_upstream_check.go b/inputs/nginx_upstream_check/nginx_upstream_check.go index 53123a0f..59bc6b7f 100644 --- a/inputs/nginx_upstream_check/nginx_upstream_check.go +++ b/inputs/nginx_upstream_check/nginx_upstream_check.go @@ -2,7 +2,6 @@ package nginx_upstream_check import ( "encoding/json" - "errors" "fmt" "io" "log" @@ -113,7 +112,7 @@ func (ins *Instance) Init() error { } if len(ins.Targets) == 0 { - return errors.New("nginx_upstream_check targets empty") + return types.ErrInstancesEmpty } client, err := ins.createHTTPClient() diff --git a/inputs/ntp/ntp.go b/inputs/ntp/ntp.go index 99f32a6f..e44f44e4 100644 --- a/inputs/ntp/ntp.go +++ b/inputs/ntp/ntp.go @@ -1,12 +1,12 @@ package ntp import ( - "errors" "log" "time" "flashcat.cloud/categraf/config" "flashcat.cloud/categraf/inputs" + "flashcat.cloud/categraf/types" "github.com/toolkits/pkg/container/list" "github.com/toolkits/pkg/nux" ) @@ -33,7 +33,7 @@ func (n *NTPStat) Drop() {} func (n *NTPStat) Init() error { if len(n.NTPServers) == 0 { - return errors.New("ntp servers empty") + return types.ErrInstancesEmpty } return nil }