ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran" <stev...@iseran.com>
Subject Re: TryCatchFinallyTask ?
Date Sun, 10 Feb 2002 18:30:59 GMT

----- Original Message -----
From: "Peter Donald" <peter@apache.org>
To: <ant-dev@jakarta.apache.org>
Sent: Sunday, February 10, 2002 1:25 AM
Subject: TryCatchFinallyTask ?


> Hi,
>
> I can't recall if this has been rejected before but I going to propose it
> again ;)
>
> Error handling in ant sucks - I have come across two today places where I
> have really wanted better handling of that sort of thing. Sometimes tasks
> throw errors that you want to respond to (ie send a mail) others throw
errors
> you can ignore (ie maudit) and in many cases you want to cleanup after you
> regardless fo success or not (delete that null.tmp!).
>
>
> Anyways I prototyped something like this for ant2 and while it hasn't been
> tested in all the places I wanted to use it - I did really like it in the
few
> places I have tested it. Basically you have as task container that looks
like
> the following. it also behaves in exactly the same way that java languaghe
> try-catch-finally constructs work.
>
> It would look like
>
> <tbody>
>   <try>
>     <echo message="About to fail"/>
>     <fail message="Failing!"/>
>   </try>
>   <catch>
>     <echo message="the task failed but we are ignoring it"/>
>   </catch>
>   <finally>
>     <echo message="Cleaning up after myself ..."/>
>   </finally>
> </tbody>
>

How does this differ from the stuff in ant-contrib on sforge?


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


Mime
View raw message