ant-contrib <trycatch> task issue!

Bharath <[email protected]> Wed, 10 Sep 2008 00:49:40 -0700
Newsgroups gmane.comp.java.ant-contrib.devel
Message-ID <[email protected]>
Hi there,

I'm using the ant contrib's <trycatch> task in an ANT script. My goal is to
invoke a Java class within the <try> block and catch an exception if my Java
class throws one in my <catch> block. If I catch the exception, I want to
set a flag for another target. I'm using the ant-contrib.jar version 1.0
beta2.

My Java class does throw an exception but my catch block doesn't catch it.
I'm pasting my ant target below. Please let me know if you have any
suggestions.

<taskdef resource="net/sf/antcontrib/antlib.xml"/>
<target name="chkTLP">
             <trycatch>
              <try>
                <!-- Call the java class here and catch an exception if
thrown -->
              </try>
              <catch>
                      <echo message = "Error caught"/> <!-- The exception
thrown by the java class is printed on the log file but control never gets
to this catch block! -->
              </catch>
             </trycatch>
</target>

What am I missing?

Thanks,

Bharath

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

_______________________________________________
Ant-contrib-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ant-contrib-developers