Log to error macro exceptions
-----------------------------

                 Key: VELOCITY-626
                 URL: https://issues.apache.org/jira/browse/VELOCITY-626
             Project: Velocity
          Issue Type: Improvement
            Reporter: Byron Foster


This patch logs to error the exceptions that occur within a macro.  This 
essentially creates a stack trace in the error log of the macro stack levels 
that contain the exception. For example: (This is with strict reference 
settings, but the same would be true without strict referencing and an 
exception was thrown from within the reference call)

#macro(foo1 $f)
  $f
#end
#macro(foo2 $e)
  #foo1($e)
#end
#foo2($x.abc)

Would create a log ouput like so:

ERROR (velocity) Variable $x has not been set at /foo.vm[line 7, column 7]
ERROR (velocity) Exception calling reference $f at /foo.vm[line 2, column 3]
ERROR (velocity) Exception in macro #foo1 at /foo.vm[line 5, column 3]
ERROR (velocity) Exception in macro #foo2 at /foo.vm[line 7, column 1]

Without this it is very difficult to find where an error occurred within nested 
macros.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to