struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lukasz Lenart (JIRA)" <j...@apache.org>
Subject [jira] [Issue Comment Deleted] (WW-4026) Exceptions swallowed in FreemarkerResult
Date Tue, 26 Mar 2013 06:29:15 GMT

     [ https://issues.apache.org/jira/browse/WW-4026?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Lukasz Lenart updated WW-4026:
------------------------------

    Comment: was deleted

(was: Could you prepare a patch and attach it here?)
    
> Exceptions swallowed in FreemarkerResult
> ----------------------------------------
>
>                 Key: WW-4026
>                 URL: https://issues.apache.org/jira/browse/WW-4026
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Value Stack
>    Affects Versions: 2.3.12
>            Reporter: Christian Wolfgang Stone
>            Assignee: Lukasz Lenart
>             Fix For: 2.3.14
>
>
> 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.
> {noformat}
> @@ -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);
> {noformat}
> Please consider implementing this. It would help a number of people who are having issues
and need to debug their ftl files.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message