Uploaded image for project: 'Apache Freemarker'
  1. Apache Freemarker
  2. FREEMARKER-48

When custom fremarker method throws exception, it is impossible to find line/row where called

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.25-incubating, 2.3.26-incubating
    • Fix Version/s: 2.3.27-incubating
    • Component/s: engine
    • Labels:
      None
    • Environment:
      Any

      Description

      Consider this stacktrace:

      https://gist.github.com/knyttl/dba8f94b9736eb2751074c34dce7b467

      On line `DispatcherServlet.renderView(DispatcherServlet.java:308)` I have started freemarker to render a template. During that process it uses custom method (`HrefMethod.exec(HrefMethod.java:28)`), but this method threw an exception. However Freemarker does not report a line/row of the template where this method was called making it very hard for debug.

      I would be happy if `freemarker.core.MethodCall._eval(MethodCall.java:65)` had some try-catch blcok, that in case of an exception would add lines/rows/details of the element that caused the exception.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              knyttl Vojtech Knyttl
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: