Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-4134

Method inPublicMode() in ModeDependentRenderExceptionHandler is never called

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Neutral
    • Resolution: Fixed
    • Affects Version/s: 4.5, 4.5.1
    • Fix Version/s: 5.4.12, 5.5.4
    • Component/s: rendering
    • Labels:
      None
    • Sprint:
      Basel 88, Basel 90
    • Story Points:
      2
    • Magnolia Release:
      5.4.12, 5.5.4

      Description

      The method inPublicMode() in ModeDependentRenderExceptionHandler is never called and ModeDependentTemplateExceptionHandler should not be deprecated because it's a key part of how the mechanism works.

      When a freemarker template fails this is what happens:

      Freemarker logs the exception always
      It will then call the TemplateExceptionHandler to let it decide what to do
      We use ModeDependentTemplateExceptionHandler which does different things depending on whether the instance is an admin or a public
      For a public: it does nothing
      For an author: it writes the exception to the output stream and then throws a TemplateException
      A thrown exception gets passed to ModeDependentRenderExceptionHandler which again tests if the instance is an author or a public
      For a public it will log the exception, but this code is never reached, see above
      For an author it will log the exception a second time and write the exception to the output stream again (without the trace and with more details)
      Note, that the error mechanism is the same for all freemarker rendering, not just the cms rendering. The user interface also uses the freemarker support, for instance the module manager ui and many gui controls, as well as the rendering of templates for email.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              fgrilli Federico Grilli
              Reporter:
              tmattsson Tobias Mattsson
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response: