From f91ca08abbc9e2184005376ff1533786f194c620 Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Fri, 4 Dec 2020 00:01:36 +0300 Subject: Add errors.Disabled in checker Init --- plugins/checker/plugin.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'plugins/checker') diff --git a/plugins/checker/plugin.go b/plugins/checker/plugin.go index c72cc615..e6250697 100644 --- a/plugins/checker/plugin.go +++ b/plugins/checker/plugin.go @@ -30,8 +30,13 @@ func (c *Plugin) Init(log log.Logger, cfg config.Configurer) error { const op = errors.Op("status plugin init") err := cfg.UnmarshalKey(PluginName, &c.cfg) if err != nil { - return errors.E(op, err) + return errors.E(op, errors.Disabled, err) + } + + if c.cfg == nil { + return errors.E(errors.Disabled) } + c.registry = make(map[string]status.Checker) c.log = log return nil -- cgit v1.2.3