We are trying to build a system in freemarker where extension files can be optionally added to replace blocks of the standard template.
We have gotten to this point
<#attempt>
<#include "extension.ftl">
<#recover>
Standard output
</#attempt>
So - if the extension.ftl file exists it will be used otherwise the part inside of the recover block is output.
The problem with this is that freemarker always logs the error that caused the recover block to trigger.
So we need one of two things:
- Don't call the include if the file doesn't exist - thus the need to check for file existence.
-OR-
- A way to prevent the logging of the error inside the recover block without changing the logging to prevent ALL freemarker errors from showing up.