ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: Retry task available in svn head
Date Fri, 18 May 2007 08:35:18 GMT
If the nested task does not fail, the loop must be finished.

+    public void execute() throws BuildException {
+        for(int i=0; i<=retryCount; i++) {
+            try {
+                nestedTask.perform();
+            } catch (Exception e) {
+                if (i<retryCount) {
+                    log("Attempt ["+i+"] error occured, retrying...", e, Project.MSG_INFO);
+                } else {
+                    throw new BuildException("Task ["+nestedTask.getTaskName()+"] failed
after ["+retryCount+"] attempts, giving up");
+                }
+            }
+        }
+    }



Jan 

>-----Urspr√ľngliche Nachricht-----
>Von: Kevin Jackson [mailto:foamdino@gmail.com] 
>Gesendet: Freitag, 18. Mai 2007 10:28
>An: Ant Developers List
>Betreff: Retry task available in svn head
>
>Hi all,
>
>Based on the feedback, I modified the task a little (only support 1
>nested task) and threw together some doc.
>
>Please -1 if you think this is unsuitable/broken/smells funny
>
>Thanks,
>Kev
>
>---------------------------------------------------------------------
>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


Mime
View raw message