Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-124623

Web content with Freemarker showing full exception with rethrow

    Details

    • Fix Priority:
      3

      Description

      The issue is that full exception with information and code is shown on a web content display error with a faulty Freemarker template, even with the template exception handler set to RETHROW.

      Based on https://freemarker.apache.org/docs/pgui_config_errorhandling.html , "TemplateExceptionHandler.RETHROW_HANDLER: Simply re-throws all exceptions; it doesn't do anything else. This should be used in most applications today. It doesn't print anything to the output about the error, which makes it safe, and the developers can still get the error details from the logs"

      This means that the shown error should be less verbose, without disclosing code or stacktrace, which should be only available in the log.

      Steps to reproduce:

      1. Create a new page with a web content display widget.
      2. Create a web content template with the contents of the attached file.
      3. Create a web content with the template and display it.

      Expected result: A simple error is show.

      Actual result: Verbose error message disclosing stacktrace and code.

        Attachments

          Activity

            People

            Assignee:
            nikoletta.buza Nikoletta Buza
            Reporter:
            nikoletta.buza Nikoletta Buza
            Participants of an Issue:
            Recent user:
            Nikoletta Buza
            Engineering Assignee:
            Nikoletta Buza
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              11 weeks ago

                Packages

                Version Package