Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 90195 invoked from network); 3 Oct 2003 15:38:07 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 3 Oct 2003 15:38:07 -0000 Received: (qmail 9581 invoked by uid 500); 3 Oct 2003 15:37:57 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 9534 invoked by uid 500); 3 Oct 2003 15:37:57 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 9520 invoked from network); 3 Oct 2003 15:37:57 -0000 Received: from unknown (HELO germane-software.com) (198.36.168.17) by daedalus.apache.org with SMTP; 3 Oct 2003 15:37:57 -0000 Received: (qmail 30094 invoked from network); 3 Oct 2003 15:28:07 -0000 Received: from unknown (HELO germane-software.com) (216.223.25.12) by 198.36.168.17 with SMTP; 3 Oct 2003 15:28:07 -0000 Message-ID: <3F7D971D.7030209@germane-software.com> Date: Fri, 03 Oct 2003 08:34:53 -0700 From: Dale Anson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20030924 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ant Developers List Subject: Re: failonerror; general solution References: <3F7D89E3.4090804@gmx.net> <03e901c389bc$c82dd650$48e304c2@efeller> <200310031557.42102.peter.reilly@corvil.com> In-Reply-To: <200310031557.42102.peter.reilly@corvil.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N What's the difference in use case between this and the try/catch from ant-contrib or antelope? I'd suggest grabbing the try/catch from either, and making it a core task. Just judging from the e-mail that I get, the try/catch task in antelope is one of the main reasons people download it. Contrast this usage with Peter's example: This should fail This will not be reached failed is ${failed} FYI, I'll be posting a new antelope distribution to sourceforge this weekend that has been updated for Ant 1.6. Dale peter reilly wrote: > Here is a task that does some like that: > > package task; > > import org.apache.tools.ant.taskdefs.Sequential; > > > public class NoFail extends Sequential { > private String failureProperty; > public void setFailureProperty(String name) { > this.failureProperty = name; > } > public void execute() { > try { > super.execute(); > } catch (Throwable t) { > if (failureProperty != null) { > getProject().setNewProperty( > failureProperty, "true"); > } > } > } > } > > Usage: > > > > classpath="classes"/> > > > > This should fail > This will not be reached > > failed is ${failed} > > > > > Peter > > On Friday 03 October 2003 15:43, Emmanuel Feller wrote: > >>I agree, it is a good option in my mind. >> >>+1 :) >> >>Emmanuel >>----- Message d'origine ----- >>De : "Jan Schroeder" >>�: >>Envoy�: vendredi 3 octobre 2003 16:38 >>Objet : failonerror; general solution >> >> >>>There are a few new entries in bugzilla regarding handling >> >>of >> >> >>>BuildExceptions. >> >>http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23540 >> >>http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23581 >> >> >>>Also, some tasks already implement some "failonerror" >> >>attribute (e.g. >> >> >>>). >>> >>>What about creating a container task instead. >>>Like: >>> >>> >>> >>> >>> >>> >>> >>>That way all tasks automatically have something like >> >>"failonerror" + you >> >> >>>actually know if the part failed and can take an >> >>appropriate build path >> >> >>>from here on. >>> >>> >>>Jan >>> >>> >>>---------------------------------------------------------- >> >>----------- >> >> >>>To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org >>>For additional commands, e-mail: dev-help@ant.apache.org >> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org >>For additional commands, e-mail: dev-help@ant.apache.org > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org > For additional commands, e-mail: dev-help@ant.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org