diff options
Diffstat (limited to 'org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac')
-rw-r--r-- | org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/client/TracXmlRpcClient.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/client/TracXmlRpcClient.java b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/client/TracXmlRpcClient.java index d724032b8..b561ec663 100644 --- a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/client/TracXmlRpcClient.java +++ b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/client/TracXmlRpcClient.java @@ -389,7 +389,8 @@ public class TracXmlRpcClient extends AbstractTracClient implements ITracWikiCli private Object call(IProgressMonitor monitor, String method, Object... parameters) throws TracException { monitor = Policy.monitorFor(monitor); - while (true) { + TracException lastException = null; + for (int attempt = 0; attempt < 3; attempt++) { if (!probed) { try { probeAuthenticationScheme(monitor); @@ -407,22 +408,28 @@ public class TracXmlRpcClient extends AbstractTracClient implements ITracWikiCli try { location.requestCredentials(AuthenticationType.REPOSITORY, null, monitor); } catch (UnsupportedRequestException ignored) { - throw e; + lastException = e; } } catch (TracPermissionDeniedException e) { try { location.requestCredentials(AuthenticationType.REPOSITORY, null, monitor); } catch (UnsupportedRequestException ignored) { - throw e; + lastException = e; } } catch (TracProxyAuthenticationException e) { try { location.requestCredentials(AuthenticationType.PROXY, null, monitor); } catch (UnsupportedRequestException ignored) { - throw e; + lastException = e; } } } + if (lastException != null) { + throw lastException; + } else { + // this path should never be reached + throw new IllegalStateException(); + } } private Object[] multicall(IProgressMonitor monitor, Map<String, Object>... calls) throws TracException { |