ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Jackson" <foamd...@gmail.com>
Subject Re: Retry task available in svn head
Date Fri, 18 May 2007 08:39:24 GMT
Hi Jan,
> 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();

yes there should be a break; here - I will update as soon as eclipse
has stopped doing some updating

> +            } 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");
> +                }
> +            }
> +        }
> +    }

Thanks for the catch, just shows that I don't have very good unit
tests, have to add that one.

Kev

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


Mime
View raw message