Robert Burrell Donkin wrote:
>
> (was [PATCH] org.apache.velocity.texen.ant.TexenTask (exception handling
> and documentation))
>
> what should an ant task do when an exception occurs?
> at the moment, texen's strategy is to swallow exceptions.
> if you're using texen to generate code, then this is a weakness.
> code generation build files typically contain compilation tasks in
> addition to generation tasks.
> since texen does not allow exceptions to propagate up to ant, this
> means that ant continues and executes any subsequent tasks in the build
> file. for code generation this is really annoying since compilation etc
> will be attempted even when a generation has failed.
>
> the patch i submitted last week improves the situation (as well as
> printing more useful messages) but IMHO doesn't go far enough. i really
> think that the strategy should be changed. Public and protected methods
> should throw ant BuildExceptions and these should be propagated up
> through the execute method to ant. This would allow subclasses to thrown
> a BuildException and stop the build going any further.
>
> comments?
I agree conceptually. I am not a texen user, so can't be sure - but
that is the general strategy for all ant tasks. And you can make ant
eat the failure, and keep going with the rest of the build (although I
am not sure in this case why you would want to.)
geir
--
Geir Magnusson Jr. [EMAIL PROTECTED]
System and Software Consulting
Developing for the web? See http://jakarta.apache.org/velocity/