ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <pe...@apache.org>
Subject Re: Continue after a failing ant task
Date Wed, 23 Jan 2002 08:25:42 GMT
On Wed, 23 Jan 2002 14:41, Daniel Ritchey wrote:
> I posted a little container task to ant-user a few days back called Error
> Catcher (under ritched2@nationwide.com) which is basically the Sequential
> container task with a try catch block around the execution of the contained
> tasks (I have since renamed the task to simply Try).  I don't have the code
> handy, but if you look at the Sequential container task code, it shouldn't
> be hard to implement your own.
>
> It looked like something to the effect of
>
> <errorcatcher errorproperty="build.failure">
>    <ant dir="./foo" />
> </errorcatcher>
>
> The property build.failure would only get created if an exception would
> occur and the properties value would be the exception message.

I have actually been experimenting with something like that - actually

<tblock>
  <try>
    ...insert tasks here ...
  </try>
  <catch>
    ...tasks ran on error...
  </catch>
  <finally>
    ...tasks always ran at end...
  </finally>
</tblock>

however your syntax is much simpler - but doesn't support <finally/> - have 
you ever needed this? Or is it safe to say that it is not needed?

-- 
Cheers,

Pete

-------------------------------------------------------
"When we remember we are all mad, the mysteries of life 
disappear and life stands explained." -Mark Twain
-------------------------------------------------------


--
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