You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by M White <tc...@yahoo.com> on 2009/08/31 12:41:44 UTC

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
 


      

Re: Code too large

Posted by David Weintraub <qa...@gmail.com>.
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.Rebhan@huk-coburg.de> wrote:

>
> -----Original Message-----
> From: M White [mailto:tc1915@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-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>


-- 
David Weintraub
qazwart@gmail.com

RE: Code too large

Posted by "Rebhan, Gilbert" <Gi...@huk-coburg.de>.
-----Original Message-----
From: M White [mailto:tc1915@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-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: Code too large

Posted by "Rebhan, Gilbert" <Gi...@huk-coburg.de>.
-----Original Message-----
From: M White [mailto:tc1915@yahoo.com] 
Sent: Monday, August 31, 2009 12:42 PM
To: ant user
Subject: Reg: Code too large

/*
 
What are these errors about  ... " Code too large .." 
What should i do ?
                     Thanks & Regards
 */

opening a browser window and asking your favorite
search engine for 'code too large' might be helpful ;-)

Regards, Gilbert


      
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org