// mainly check the number of arguments
vmProxy.init(rsvc, context, node);
}
catch (TemplateInitException die)
{
Info info = new Info(sourceTemplate, node.getLine(), node.getColumn());
throw new ParseErrorException(die.getMessage() + " at "
+ Log.formatFileString(info), info);
}
try
{
return vmProxy.render(context, writer, node);
}
catch (RuntimeException e)
{
/**
* We catch, the exception here so that we can record in
* the logs the template and line number of the macro call
* which generate the exception. This information is
* especially important for multiple macro call levels.
* this is also true for the following catch blocks.
*/
rsvc.getLog().error("Exception in macro #" + macroName + " at " +
Log.formatFileString(sourceTemplate, getLine(), getColumn()));
throw e;
}
catch (IOException e)
{
rsvc.getLog().error("Exception in macro #" + macroName + " at " +
Log.formatFileString(sourceTemplate, getLine(), getColumn()));
throw e;
}
}
else if (strictRef)
{
Info info = new Info(sourceTemplate, node.getLine(), node.getColumn());
throw new ParseErrorException("Macro '#" + macroName + "' is not defined at "
+ Log.formatFileString(info), info);
}
/**