return an error if not appsec-rules matches

This commit is contained in:
Sebastien Blot 2023-12-05 01:01:15 +01:00
parent 52c1e16216
commit bb307dd339
No known key found for this signature in database
GPG key ID: DFC2902F40449F6A

View file

@ -1,6 +1,7 @@
package appsec
import (
"fmt"
"os"
"path/filepath"
"strings"
@ -128,6 +129,9 @@ func LoadCollection(pattern string, logger *log.Entry) ([]AppsecCollection, erro
}
ret = append(ret, appsecCol)
}
if len(ret) == 0 {
return nil, fmt.Errorf("no appsec-rules found for pattern %s", pattern)
}
return ret, nil
}