Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: 1.5
    • Component/s: Engine
    • Labels:
      None
    • Environment:
      Operating System: other
      Platform: Other

      Description

      Enhance the ParseErrorException to report:

      • template name (path)
      • error line
      • error column

      The Click framework attempts to render the template error highlighting the
      offending line. However when templates or macros are included in a page, the
      source of the error cannot be determined from the ParseErrorException message.

      If the additional properties could be added to the ParseErrorException
      the framework could accurately render the offending template error. This
      information should enable quicker debugging of usage errors by all Velocity users.

      1. ASF.LICENSE.NOT.GRANTED--ParseException.txt
        2 kB
        Malcolm Edgar
      2. ASF.LICENSE.NOT.GRANTED--Parser.txt
        1 kB
        Malcolm Edgar
      3. ASF.LICENSE.NOT.GRANTED--ParseErrorException.txt
        3 kB
        Malcolm Edgar
      4. ASF.LICENSE.NOT.GRANTED--ParseErrorException.txt
        3 kB
        Malcolm Edgar
      5. ASF.LICENSE.NOT.GRANTED--Template.txt
        0.9 kB
        Malcolm Edgar
      6. Parser.jjt.txt
        0.7 kB
        Malcolm Edgar

        Issue Links

          Activity

          Hide
          Malcolm Edgar added a comment -

          Created an attachment (id=14774)
          enhancement implementation

          Patch file 1 of 4

          Show
          Malcolm Edgar added a comment - Created an attachment (id=14774) enhancement implementation Patch file 1 of 4
          Hide
          Malcolm Edgar added a comment -

          Created an attachment (id=14775)
          enhancement implementation

          file 2 of 4

          Show
          Malcolm Edgar added a comment - Created an attachment (id=14775) enhancement implementation file 2 of 4
          Hide
          Malcolm Edgar added a comment -

          Created an attachment (id=14776)
          enhancement implementation

          file 3 of 4

          Show
          Malcolm Edgar added a comment - Created an attachment (id=14776) enhancement implementation file 3 of 4
          Hide
          Malcolm Edgar added a comment -

          Created an attachment (id=14777)
          enhancement implementation

          file 3 of 4

          Show
          Malcolm Edgar added a comment - Created an attachment (id=14777) enhancement implementation file 3 of 4
          Hide
          Malcolm Edgar added a comment -

          Created an attachment (id=14778)
          enhancement implementation

          file 4 of 4

          Conforms to Velocity coding standard, passes Velocity unit tests Tested on
          Click framework.

          Show
          Malcolm Edgar added a comment - Created an attachment (id=14778) enhancement implementation file 4 of 4 Conforms to Velocity coding standard, passes Velocity unit tests Tested on Click framework.
          Hide
          Will Glass-Husain added a comment -

          Thanks - this has been needed. I'll take a look at it. Appreciate you
          checking the unit tests and coding standards - that helps.

          Show
          Will Glass-Husain added a comment - Thanks - this has been needed. I'll take a look at it. Appreciate you checking the unit tests and coding standards - that helps.
          Hide
          Will Glass-Husain added a comment -

          Velocity-373 presents a patch to this issue.

          Show
          Will Glass-Husain added a comment - Velocity-373 presents a patch to this issue.
          Hide
          Will Glass-Husain added a comment -

          Malcolm –

          Took a look at the patch. Looks good, but we can't modify Parser.java. This is automatically created by javacc whenever the language syntax file (Parser.jjt) is edited.

          Can you restructure this in a way that doesn't require a modification to Parser.java? Otherwise this would be ready to commit.

          WILL

          Show
          Will Glass-Husain added a comment - Malcolm – Took a look at the patch. Looks good, but we can't modify Parser.java. This is automatically created by javacc whenever the language syntax file (Parser.jjt) is edited. Can you restructure this in a way that doesn't require a modification to Parser.java? Otherwise this would be ready to commit. WILL
          Hide
          Will Glass-Husain added a comment -

          Also, it's a little easier (though not required) if you include all the files together in the diff. If you are using subversion, run diff on the directory. If you are using an IDE, you might be able to use that to generate the diff.

          Thanks again for contributing.

          Show
          Will Glass-Husain added a comment - Also, it's a little easier (though not required) if you include all the files together in the diff. If you are using subversion, run diff on the directory. If you are using an IDE, you might be able to use that to generate the diff. Thanks again for contributing.
          Hide
          Will Glass-Husain added a comment -

          Malcom,

          Just as a heads-up. If you are willing and have the time to restructure this patch, we'll need it by late October to get it in version 1.5. Thanks, WILL

          Show
          Will Glass-Husain added a comment - Malcom, Just as a heads-up. If you are willing and have the time to restructure this patch, we'll need it by late October to get it in version 1.5. Thanks, WILL
          Hide
          Malcolm Edgar added a comment -

          Requested Parser.jjt

          Show
          Malcolm Edgar added a comment - Requested Parser.jjt
          Hide
          Will Glass-Husain added a comment -

          Patch applied. Thanks Malcolm for pushing this along with a patch and a use case.

          Three changes:

          • made a test case
          • changed a few other "new ParserErrorException ( pe.getMessage() ) to new ParserErrorException ( pe ) . This makes this work with Velocity.evaluate()
          • added a missing constructor to ParserException (still needed the three parameter constructor since I couldn't patch Parser.java)
          Show
          Will Glass-Husain added a comment - Patch applied. Thanks Malcolm for pushing this along with a patch and a use case. Three changes: made a test case changed a few other "new ParserErrorException ( pe.getMessage() ) to new ParserErrorException ( pe ) . This makes this work with Velocity.evaluate() added a missing constructor to ParserException (still needed the three parameter constructor since I couldn't patch Parser.java)
          Hide
          Henning Schmiedehausen added a comment -

          Close all resolved issues for Engine 1.5 release.

          Show
          Henning Schmiedehausen added a comment - Close all resolved issues for Engine 1.5 release.

            People

            • Assignee:
              Unassigned
              Reporter:
              Malcolm Edgar
            • Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development