Carsten Ziegeler wrote:
To be honest, I hadn't got my head around how to handle error conditions within the task. Maybe it should throw a BuildException, but as you observed, I didn't quite know what to do with this error - my Ant knowledge was too shaky (and stil is) to work out exactly what to do. Do you have any ideas of the best way to handle error reporting here?The CocoonTask class in o.a.c has a javadoc error for the execute() method:
/** * Do the execution and return a return code. * * @return the return code from the execute java class if it was * executed in a separate VM (fork = "yes"). * * @throws BuildException if required parameters are missing */ public void execute() throws BuildException { // FIXME - This is never read int err= -1;
This method doesn't return anything, so the javadoc is wrong. It seems
that the original author wanted to return the int "err", but the
signature of execute() (from Ant's Task class) doesn't allow this.
I guess that a BuildException should be thrown?
The CocoonTask is based upon a simplified Java task, taken from within Ant itself, and with references to forking and a lot of other stuff removed.
Regards, Upayavira
