Description
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.