From ant-dev-return-25097-qmlist-jakarta-archive-ant-dev=jakarta.apache.org@jakarta.apache.org Sun Feb 10 09:29:50 2002 Return-Path: Delivered-To: apmail-jakarta-ant-dev-archive@apache.org Received: (qmail 81835 invoked from network); 10 Feb 2002 09:29:50 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 10 Feb 2002 09:29:50 -0000 Received: (qmail 1103 invoked by uid 97); 10 Feb 2002 09:29:58 -0000 Delivered-To: qmlist-jakarta-archive-ant-dev@jakarta.apache.org Received: (qmail 1087 invoked by uid 97); 10 Feb 2002 09:29:58 -0000 Mailing-List: contact ant-dev-help@jakarta.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 ant-dev@jakarta.apache.org Received: (qmail 1076 invoked from network); 10 Feb 2002 09:29:57 -0000 Message-Id: <200202100929.g1A9TuE01804@mail016.syd.optusnet.com.au> Content-Type: text/plain; charset="iso-8859-1" From: Peter Donald To: ant-dev@jakarta.apache.org Subject: TryCatchFinallyTask ? Date: Sun, 10 Feb 2002 20:25:54 +1100 X-Mailer: KMail [version 1.3.2] X-Wisdom-Cookie: . MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi, I can't recall if this has been rejected before but I going to propose it again ;) Error handling in ant sucks - I have come across two today places where I have really wanted better handling of that sort of thing. Sometimes tasks throw errors that you want to respond to (ie send a mail) others throw errors you can ignore (ie maudit) and in many cases you want to cleanup after you regardless fo success or not (delete that null.tmp!). Anyways I prototyped something like this for ant2 and while it hasn't been tested in all the places I wanted to use it - I did really like it in the few places I have tested it. Basically you have as task container that looks like the following. it also behaves in exactly the same way that java languaghe try-catch-finally constructs work. It would look like And would result in something like About to fail the task failed but we are ignoring it Cleaning up after myself ... The term sucks and I have tried to think of a nice name for it. I tried a few - I believe I committed seomething like "try-catch" into myrmidon but maybe a better name for task would be or something ? Thoughts? -- Cheers, Pete *-----------------------------------------------------* | For those who refuse to understand, no explanation | | will ever suffice. For those who refuse to believe, | | no evidence will ever suffice. | *-----------------------------------------------------* -- To unsubscribe, e-mail: For additional commands, e-mail: