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.
Thanks, I will apply this today. Sorry for the delay. Have been sick
the last couple of days. Thanks for the patch :-)
>
> - robert
>
> ------------------------------------------------------------------------
> Name: TexenTask_patch.txt
> TexenTask_patch.txt Type: Plain Text (text/plain)
> Encoding: quoted-printable
>
> ------------------------------------------------------------------------
--
jvz.
Jason van Zyl
[EMAIL PROTECTED]
http://jakarta.apache.org/velocity
http://jakarta.apache.org/turbine
http://jakarta.apache.org/commons
http://tambora.zenplex.org