Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Lindberg2009-04-28 15:29:08 +0000
committerHenrik Lindberg2009-04-28 15:29:08 +0000
commit0466838d72f58188d39507baed0319c88b52b5ff (patch)
tree5a3079874bb9222e007a0d20e515194f26b6bd82 /bundles/org.eclipse.equinox.p2.metadata.repository
parent04801421fb6c0fed7e4369fbd0a47482af868fd6 (diff)
downloadrt.equinox.p2-0466838d72f58188d39507baed0319c88b52b5ff.tar.gz
rt.equinox.p2-0466838d72f58188d39507baed0319c88b52b5ff.tar.xz
rt.equinox.p2-0466838d72f58188d39507baed0319c88b52b5ff.zip
Bug 274011 [ui] Available Software Dialog handles "authentication problem" badly.
Exceptions and status codes now find their way to the UI. The remainder needs to be handled there though.
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.metadata.repository')
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CacheManager.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CacheManager.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CacheManager.java
index 19ba18cbc..b13355b2f 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CacheManager.java
+++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CacheManager.java
@@ -87,6 +87,7 @@ public class CacheManager {
* @throws AuthenticationFailedException if jar not available and xml causes authentication fail
* @throws IOException on general IO errors
* @throws ProvisionException on any error (e.g. user cancellation, unknown host, malformed address, connection refused, etc.)
+ * @throws OperationCanceledException - if user canceled
*/
public File createCache(URI repositoryLocation, String prefix, IProgressMonitor monitor) throws IOException, ProvisionException {
@@ -121,6 +122,10 @@ public class CacheManager {
lastModifiedRemote = getTransport().getLastModified(jarLocation, submonitor.newChild(1));
if (lastModifiedRemote <= 0)
LogHelper.log(new Status(IStatus.WARNING, Activator.ID, "Server returned lastModified <= 0 for " + jarLocation)); //$NON-NLS-1$
+ } catch (AuthenticationFailedException e) {
+ // it is not meaningful to continue - the credentials are for the server
+ // do not pass the exception - it gives no additional meaningful user information
+ throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_AUTHENTICATION, NLS.bind(Messages.CacheManager_AuthenticationFaileFor_0, repositoryLocation), null));
} catch (Exception e) {
// not ideal, just skip the jar on error, and try the xml instead - report errors for
// the xml.
@@ -151,7 +156,8 @@ public class CacheManager {
} catch (FileNotFoundException e) {
throw new FileNotFoundException(NLS.bind(Messages.CacheManager_Neither_0_nor_1_found, jarLocation, xmlLocation));
} catch (AuthenticationFailedException e) {
- throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_NOT_FOUND, NLS.bind(Messages.CacheManager_AuthenticationFaileFor_0, repositoryLocation), e));
+ // do not pass the exception, it provides no additional meaningful user information
+ throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_AUTHENTICATION, NLS.bind(Messages.CacheManager_AuthenticationFaileFor_0, repositoryLocation), null));
} catch (CoreException e) {
IStatus status = e.getStatus();
if (status == null)

Back to the top