Update of /cvsroot/webmacro/webmacro/src/org/webmacro/directive
In directory usw-pr-cvs1:/tmp/cvs-serv5401/src/org/webmacro/directive
Modified Files:
ForeachDirective.java
Log Message:
clean up the "blah is not a list" warning message generated by #foreach to include the $VariableName, the context location, and the class type of the object that isn't a list.
Index: ForeachDirective.java
===================================================================
RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/directive/ForeachDirective.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** ForeachDirective.java 11 Jun 2002 17:43:20 -0000 1.15
--- ForeachDirective.java 31 Oct 2002 17:34:03 -0000 1.16
***************
*** 134,141 ****
try {
iter = context.getBroker()._propertyOperators.getIterator(l);
! }
! catch (Exception e) {
! String warning = "#foreach: list argument is not a list: " + l;
! context.getLog("engine").warning(warning + "; " + e);
writeWarning(warning, context, out);
return;
--- 134,146 ----
try {
iter = context.getBroker()._propertyOperators.getIterator(l);
! } catch (Exception e) {
! String warning = "#foreach: ";
! if (list instanceof Variable)
! warning += "$" + ((Variable) list).getVariableName();
! else
! warning += list;
!
! warning += ": " + e.getMessage() + " at " + context.getCurrentLocation();
! context.getLog("engine").warning(warning);
writeWarning(warning, context, out);
return;
|