return on parse template error unconditionally
@@ -7,7 +7,6 @@ import (
"gopkg.in/yaml.v2"
- "github.com/projectdiscovery/gologger"
"github.com/projectdiscovery/nuclei/v2/pkg/catalog/loader/filter"
"github.com/projectdiscovery/nuclei/v2/pkg/model"
"github.com/projectdiscovery/nuclei/v2/pkg/templates"
@@ -104,7 +103,6 @@ var (
parsedTemplatesCache *cache.Templates
ShouldValidate bool
NoStrictSyntax bool
- fieldErrorRegexp = regexp.MustCompile(`not found in`)
templateIDRegexp = regexp.MustCompile(`^([a-zA-Z0-9]+[-_])*[a-zA-Z0-9]+$`)
)
@@ -140,18 +138,9 @@ func ParseTemplate(templatePath string) (*templates.Template, error) {
err = yaml.UnmarshalStrict(data, template)
}
if err != nil {
- errString := err.Error()
- if !fieldErrorRegexp.MatchString(errString) {
stats.Increment(SyntaxErrorStats)
return nil, err
}
- stats.Increment(SyntaxWarningStats)
- if ShouldValidate {
- gologger.Error().Msgf("Syntax warnings for template %s: %s", templatePath, err)
- } else {
- gologger.Warning().Msgf("Syntax warnings for template %s: %s", templatePath, err)
- }
- }
parsedTemplatesCache.Store(templatePath, template, nil)
return template, nil
}
