ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From RITCH...@Nationwide.com
Subject Error catching container task
Date Wed, 16 Jan 2002 22:02:04 GMT
Here is a little container task I wrote that executes its tasks in
sequential order but it will catch any BuildException that occurs.   If an
exception occurs it will place the exception message in a new property with
the name of your choosing.  The code is pretty trivial, but I have found it
to useful.  Feel free to use it however you see fit.

Example build.xml ...

<project default="test">

     <target name="test">
          <taskdef name="errorcatcher" classname
="ErrorCatcherTaskContainer"/>

          <errorcatcher errorproperty="error.message">
               <fail message="testing testing testing 1 2 3" />
          </errorcatcher>

          <echo message="${error.message}" />
     </target>

</project>

(See attached file: ErrorCatcher.zip)
Mime
View raw message