I think you are right here. I like the patches. I will put in the
javadoc fixes, and if no one squawks, will do the code paches as well a
little later today. I am not a Texen expert so will wait a few hours.
geir
Robert Burrell Donkin wrote:
>
> org.apache.velocity.texen.ant.TexenTask.execute() currently deals with
> exceptions thrown during the generation process by printing a standard
> stack trace. IMHO this is not the best way to handle them. exceptions
> should be rethrown as org.apache.tools.ant.BuildException's for the
> following reasons:
>
> 1. ant understands that when a BuildException is thrown, an error has
> prevented the task from completing. processing of the build then stops.
> this is very useful when you have a single ant build file containing
> both code generation tasks and compilation tasks - if a code generation
> task fails, then compilation does not proceed.
> 2. ant BuildExceptions can contain a causal exception. this means that
> more useful messages can be given to the user rather than a simple stack
> trace. ant does quite a good job of formatting BuildExceptions - texen
> should take advantage.
> 3. (as far as i can see) catching and rethrowing seems to be the ant way
> to do these things.
>
> this patch catchs exceptions and rethrows them as BuildExceptions for
> Ant to deal with. known velocity exceptions are caught and rethrown with
> additional messages.
>
> this patch also contains some small improvements to the (javadoc)
> documentation.
>
> - robert
>
> ------------------------------------------------------------------------
> Name: TexenTask_patch.txt
> TexenTask_patch.txt Type: Plain Text (text/plain)
> Encoding: quoted-printable
>
> ------------------------------------------------------------------------
--
Geir Magnusson Jr. [EMAIL PROTECTED]
System and Software Consulting
Developing for the web? See http://jakarta.apache.org/velocity/