ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicolas Vervelle <nicolas.verve...@steria.com>
Subject Re: Fail message in a try ... catch
Date Wed, 05 Apr 2006 08:16:20 GMT
Reorganize your code: put the <trycatch> inside <sequential> not outside


ar wrote:
> Hi all,
>
>
> I loop on a fileset and use antcall to call a target for each file. 
> Processing file tasks can fail. I use the Ant-Contrib trycatch task to 
> make some alternative processing and customize error messages in my 
> catch section whenever one task fails (<fail message="..." /> .
> I'd like to include the file name in my fail message (@{file} doesn't 
> work).
> Does anybody knows how I could do that ?
>
>
>
>       <trycatch property="processing.file.error">
>          <try>
>             <for param="file">
>                <path>
>                   <fileset dir="myfiles">
>                      <include name="**/*.ext" />
>                   </fileset>
>                </path>
>                <sequential>
>                   <antcall target="process_file">
>                      <param name="file.path" value="@{file}" />
>                   </antcall>
>                </sequential>
>             </for>
>          </try>
>          <catch>
>             ...
>             <fail message="Error processing file 
> ${i.d.like.th.file.name.here} " />
>          </catch>
>       </trycatch>
>
> --A. ROY
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>


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


Mime
View raw message