Hi Gilbert, Many many thanks for your clear and easy to follow help! Very much appreciated.
Thanks, Timujain Rebhan, Gilbert wrote: > > > Hi, > > 1. ant-contrib has a <try> ... <catch> task > > see http://ant-contrib.sourceforge.net/tasks/tasks/index.html > and Logic Tasks / Trycatch > > 2. some tasks f.e. <exec> have a resultproperty /outproperty > you can check that property with a condition > > <condition property="prop"> > <equals arg1="${resultproperty}" arg2="0" /> > </condition> > <fail unless="prop" message="error -- rc != 0 " /> > > > or with ant-contrib if / else / then, example = > > <!-- start ksh script --> > <echo>${kshscript.prefix} activate ${projekt} ${lum} ${earfile}</echo> > > <exec executable="${plinkexec}" resultproperty="rc.activate" > failonerror="false"> > ... > > you have to use failonerror="false" here if you don't want an instant > Build failed and handle that error yourself !! > > </exec> > > <!-- ...check RC --> > <target name="main" depends="depends" > > > <echo>+++ Returncode was_deploy_scm.ksh activate ==> ${rc.activate} > +++</echo> > <if> > <not> > <equals arg1="${rc.activate}" arg2="0" /> > </not> > <then> > <echo>+++ RC Shellscript != 0 +++${line.separator}Abbruch :-( > !!</echo> > <fail /> > </then> > </if> > > > or the depending target checks the property with > > <target name="foo" if="${resultproperty}> > or > <target name="foo" unless="${resultproperty}> > > > Regards, Gilbert > > -----Original Message----- > From: timujain [mailto:[EMAIL PROTECTED] > Sent: Friday, August 11, 2006 8:27 AM > To: user@ant.apache.org > Subject: Detecting <target> failure! > > > Hi there, > How can I detect <target> or <task> failure to call another <target> as > plan > B rather than failing the entire build? > -- > View this message in context: > http://www.nabble.com/Detecting-%3Ctarget%3E-failure%21-tf2088943.html#a > 5757429 > Sent from the Ant - Users forum at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Detecting-%3Ctarget%3E-failure%21-tf2088943.html#a5807277 Sent from the Ant - Users forum at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]