Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3.12
-
None
Description
I notice that exceptions parsing freemarker results are swallowed (ie: not reported, logged, or passed on). I put in a fix 2 years ago and have been updating my fix in the code ever since. This does work very well for me.
@@ -118,6 +120,8 @@ private String pContentType = "text/html"; private static final String PARENT_TEMPLATE_WRITER = FreemarkerResult.class.getName() + ".parentWriter"; + private static final Logger LOG = LoggerFactory.getLogger(FreemarkerResult.class); + public FreemarkerResult() { super(); } @@ -200,6 +204,14 @@ } else { template.process(model, writer); } + } catch (TemplateException e) { + if (LOG.isErrorEnabled()) + LOG.error("Error processing Freemarker result",e); + throw e; + } catch (IOException e) { + if (LOG.isErrorEnabled()) + LOG.error("Error processing Freemarker result",e); + throw e; } finally { // Give subclasses a chance to hook into postprocessing postTemplateProcess(template, model);
Please consider implementing this. It would help a number of people who are having issues and need to debug their ftl files.