ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran" <stev...@iseran.com>
Subject Re: Clean up on task failure
Date Tue, 19 Feb 2002 18:19:04 GMT

----- Original Message -----
From: "Mike Sexter" <Mike.Sexter@oracle.com>
To: "Ant Users List" <ant-user@jakarta.apache.org>
Sent: Monday, February 18, 2002 16:18
Subject: Re: Clean up on task failure


> This is a general question, not specific to the 'sql' task. Basically I'm
looking for suggestions on the easiest way to implement an task or target
error handler. In other words, I have a couple of targets that invoke an
'exec' task. If a particular task fails, I may need to do some clean-up
before exiting the build script.
>
> One solution is to write a task subclass that overrides the 'execute()'
method, catches 'BuildException', calls the specified error handler and then
rethrows the exception. Not too complicated but I'm sure someone out there
has come up with a technique to handle this situation within the build
script itself. Perhaps a clever combination of dependencies and property
setting. If so, I'd like to hear about it.
>

There is some discourse on whether (and how) to support a try/catch
construct in ant. In the meantime. the ant-contrib project on sourceforge
has such a task you can d/l and use in your own project.

-steve


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message