Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.6, 1.6.1, 1.7
-
None
-
None
Description
The following VTL calls the toString() method on the object in $foo:
#if($foo)#end
If the toString() method throws an exception, the exception is thrown all the way out of velocity without any indication of where the vtl reference occurred. This patch wraps the exception with a VelocityException with a message that indicates the location of the offending reference.
However, I wonder why toString() is called at all... the code tests for toString() == null and returns false if so, and true otherwise in the above example vtl. Why is this test necessary, and why isn't just a non-null object enough for testing?