Netcentric / accesscontroltool

Rights and roles management for AEM made easy
Eclipse Public License 1.0
147 stars 92 forks source link

RuntimeExceptions thrown from YamlMacroProcessorImpl are not enriched with YAML source file name and position #711

Open kwin opened 2 months ago

kwin commented 2 months ago

In case of runtime exceptions in the YamlMacroProcessorImpl you just see an exception/error like this:

org.apache.jackrabbit.vault.packaging.PackageException: LOOP over EL ${${whitelistedTenants}} is null
....
Caused by: java.lang.IllegalStateException: LOOP over EL ${${whitelistedTenants}} is null
    at biz.netcentric.cq.tools.actool.configreader.YamlMacroProcessorImpl.evaluateForStatement(YamlMacroProcessorImpl.java:226)
    at biz.netcentric.cq.tools.actool.configreader.YamlMacroProcessorImpl.transform(YamlMacroProcessorImpl.java:138)
    at biz.netcentric.cq.tools.actool.configreader.YamlMacroProcessorImpl.transform(YamlMacroProcessorImpl.java:124)
    at biz.netcentric.cq.tools.actool.configreader.YamlMacroProcessorImpl.transform(YamlMacroProcessorImpl.java:155)
    at biz.netcentric.cq.tools.actool.configreader.YamlMacroProcessorImpl.transform(YamlMacroProcessorImpl.java:124)
    at biz.netcentric.cq.tools.actool.configreader.YamlMacroProcessorImpl.processMacros(YamlMacroProcessorImpl.java:66)
    at biz.netcentric.cq.tools.actool.configreader.YamlConfigurationMerger.getMergedConfigurations(YamlConfigurationMerger.java:134)

The stack trace and the error message doesn't give a pointer where in which YAML file this line is coming from.