There's a 64K limit to what try/catch can store and you are running into
that limit.

What exactly are you trying to do? Do you want to fail if your command can't
run? Have your batchfile send an error code upon exit. Ant can detect that
and report it as a failure. Make sure you set* <exec failonerror="true">*.

Another possibility is to have an errorproperty and not fail the build on a
bad <exec> (*<exec failonerror="false errorproperty="exec.failed">*). That
will allow you to detect a failed command without going through the trycatch
business.


On Tue, Sep 1, 2009 at 5:45 AM, Rebhan, Gilbert <
gilbert.reb...@huk-coburg.de> wrote:

>
> -----Original Message-----
> From: M White [mailto:tc1...@yahoo.com]
> Sent: Monday, August 31, 2009 12:42 PM
> To: ant user
> Subject: Reg: Code too large
>
> /*
> Hi,
>     I am compiling some files .... and i am getting the error -
>
> Code too large for try .
> Code too large for catch
>
> But ultimately in the logs its printing ... Build Successful.
>
> What are these errors about  ... " Code too large .."
> What should i do ?
>                      Thanks & Regards
>  */
>
> you need a fail in your catch block to make it fail, f.e. =
>
> <trycatch>
>      <try>
>        <exec dir="C:/notexistent/path" executable="cmd.exe">
>          <arg line="/c foobar" />
>        </exec>
>      </try>
>      <catch>
>      ... other stuff ...
>        <fail message="...."/> <<<<<<<<<<<<<<
>      </catch>
>    </trycatch>
>
> without that fail your errrors get catched and it's always
> BUILD SUCCESSFUL
>
>
>
> Regards, Gilbert
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
> For additional commands, e-mail: user-h...@ant.apache.org
>
>


-- 
David Weintraub
qazw...@gmail.com

Reply via email to