summaryrefslogtreecommitdiff
path: root/plugins/checker
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-12-04 00:01:36 +0300
committerValery Piashchynski <[email protected]>2020-12-04 00:01:36 +0300
commitf91ca08abbc9e2184005376ff1533786f194c620 (patch)
tree7431dccaac1efee0e3bf33dc23debde1051d5157 /plugins/checker
parente6034b5e5aedfb2bacea0a0610c6ae30921461e1 (diff)
Add errors.Disabled in checker Init
Diffstat (limited to 'plugins/checker')
-rw-r--r--plugins/checker/plugin.go7
1 files changed, 6 insertions, 1 deletions
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