Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-435

ParseErrorException not thrown with #macro parse error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.5
    • 1.5
    • Engine
    • None
    • Windows XP, JDK 1.4.2_09

    Description

      I have just been reviewing the new error handlingin Velocity 1.5-dev.
      One change I have observed it that an invalid macro call, passing 2
      arguments instead of one will log an error message:

      [Velocity] [error] VM #writeForm: error : too many arguments to macro.
      Wanted 1 got 2
      [Velocity] [error] VM error writeForm. Null AST

      However it will not throw an ParseErrorException like it used to in
      1.5-dev. Please see the example below for the earlier behaviour:

      http://www.sunvolt.com/click-examples/exception.htm?actionLink=brokenBorderLink#

      I prefer earlier approach, as the error is explicit. The new approach
      logs an error message, but beyond that you would not have known that
      an error occured. The #writeForm() call is not even rendered, as is
      done with an invalid object reference.

      regards Malcolm Edgar

      Attachments

        1. macroargumenterror.patch
          9 kB
          William Glass-Husain

        Activity

          People

            wglass William Glass-Husain
            medgar Malcolm Edgar
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: