aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/config.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/config/config.go b/config/config.go
index 8b409fe7..80322018 100644
--- a/config/config.go
+++ b/config/config.go
@@ -304,7 +304,7 @@ func (config *AercConfig) LoadConfig(file *ini.File) error {
filter.Header = strings.ToLower(header)
filter.Regex, err = regexp.Compile(regex)
if err != nil {
- panic(err)
+ return err
}
} else if strings.ContainsRune(match, ',') {
filter.FilterType = FILTER_HEADER
@@ -312,6 +312,9 @@ func (config *AercConfig) LoadConfig(file *ini.File) error {
value := filter.Filter[strings.Index(filter.Filter, ",")+1:]
filter.Header = strings.ToLower(header)
filter.Regex, err = regexp.Compile(regexp.QuoteMeta(value))
+ if err != nil {
+ return err
+ }
} else {
filter.FilterType = FILTER_MIMETYPE
}