Percussion template error handling

I have a template that loops through thousands of content items to publish a list of files, but some files throw an error on the location generate because the items have lost thier folder relationship.

#set($clonedItem = $sys.assemblyItem.clone())
#set($ret = $clonedItem.setParameterValue(“sys_context”,“394”))
#set($pubpath = $rx.location.generate($clonedItem))

Is there a way to do error handling on the template to see if the location function call will error and render and error message instead?

Hi Mark,

What does the query look like? Does it include sys_folderid in the select list? I think that may filter out items that don’t live in a folder. You could also add try adding jcr:path to the select list and testing that value before doing the location.generate.


thanks, I think that would work. I try that.

I was using *

“SELECT * FROM rx:” + $contenttype + " where rx:sys_contentid > " + $startid