Re: ant-contrib <trycatch> task issue!

Jack Woehr <[email protected]> Fri, 12 Sep 2008 00:08:52 -0600
Newsgroups gmane.comp.java.ant-contrib.devel
Message-ID <[email protected]>
Bharath wrote:
> 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.
Hi Bharath --

W/r/t Ant-contrib <trycatch> , here is a snippet from the documentation:

    /This mirrors Java's try/catch/finally.
    /

"Mirrors" meaning to say "is analogous to".

    /The tasks inside of the required |<try>| element will be run. If
    one of them should throw a BuildException several things can happen:/

... etc.

Does your failing Java class test throw an Ant-contrib BuildException? I 
take the documentation
to mean that only a BuildException being thrown will be caught in the 
<catch> block. It is not
a universal Java try/catch facility.

-- 
Jack J. Woehr            # "Self-delusion is
http://www.well.com/~jax #  half the battle!"
http://www.softwoehr.com #  - Zippy the Pinhead

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