Display filename when encountering bad rule file.

Change-Id: I4729371be92c5659a6938145c5fde66771d7be22
This commit is contained in:
Julius Volz 2013-12-09 17:01:51 +01:00
parent fb44580110
commit 77a79d1fc0

View File

@ -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...)