From 77a79d1fc0a4f1f14672085d5785a2e6c712692a Mon Sep 17 00:00:00 2001 From: Julius Volz Date: Mon, 9 Dec 2013 17:01:51 +0100 Subject: [PATCH] Display filename when encountering bad rule file. Change-Id: I4729371be92c5659a6938145c5fde66771d7be22 --- rules/manager.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rules/manager.go b/rules/manager.go index e585bf7c3..727085173 100644 --- a/rules/manager.go +++ b/rules/manager.go @@ -14,6 +14,7 @@ package rules import ( + "fmt" "sync" "time" @@ -167,7 +168,7 @@ func (m *ruleManager) AddRulesFromConfig(config config.Config) error { for _, ruleFile := range config.Global.RuleFile { newRules, err := LoadRulesFromFile(ruleFile) if err != nil { - return err + return fmt.Errorf("%s: %s", ruleFile, err) } m.Lock() m.rules = append(m.rules, newRules...)