Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault (Ericsson)2013-05-14 16:28:13 +0000
committerPascal Rapicault2013-05-16 17:10:52 +0000
commit054533b73d0db12e67279ea48520bbc4c692e462 (patch)
treed0a284f93fb7f3de6538de0f4858bc80be49ab62 /bundles/org.eclipse.equinox.p2.transport.ecf
parentfc6a1a5240224ab856a523e89bf15d04f776394b (diff)
downloadrt.equinox.p2-054533b73d0db12e67279ea48520bbc4c692e462.tar.gz
rt.equinox.p2-054533b73d0db12e67279ea48520bbc4c692e462.tar.xz
rt.equinox.p2-054533b73d0db12e67279ea48520bbc4c692e462.zip
Bug 408018 - [repository] Repository that raises HttpConnectionException
are not marked as invalid
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.transport.ecf')
-rw-r--r--bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/RepositoryStatus.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/RepositoryTransport.java2
2 files changed, 7 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/RepositoryStatus.java b/bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/RepositoryStatus.java
index cc68acba0..6bca78305 100644
--- a/bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/RepositoryStatus.java
+++ b/bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/RepositoryStatus.java
@@ -11,15 +11,15 @@
package org.eclipse.equinox.internal.p2.transport.ecf;
-import org.eclipse.equinox.internal.p2.repository.DownloadStatus;
-import org.eclipse.equinox.p2.core.ProvisionException;
-
import java.io.FileNotFoundException;
import java.net.*;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.ecf.core.identity.IDCreateException;
import org.eclipse.ecf.filetransfer.BrowseFileTransferException;
import org.eclipse.ecf.filetransfer.IncomingFileTransferException;
+import org.eclipse.equinox.internal.p2.repository.DownloadStatus;
+import org.eclipse.equinox.internal.p2.repository.Messages;
+import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.osgi.util.NLS;
/**
@@ -117,6 +117,8 @@ public class RepositoryStatus {
public static DownloadStatus forException(Throwable t, URI toDownload) {
if (t instanceof FileNotFoundException || (t instanceof IncomingFileTransferException && ((IncomingFileTransferException) t).getErrorCode() == 404))
return new DownloadStatus(IStatus.ERROR, Activator.ID, ProvisionException.ARTIFACT_NOT_FOUND, NLS.bind(Messages.artifact_not_found, toDownload), t);
+ if (t.getClass().getName().equals("org.apache.http.conn.HttpHostConnectException"))
+ return new DownloadStatus(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_INVALID_LOCATION, NLS.bind(Messages.TransportErrorTranslator_UnknownHost, toDownload), t);
if (t instanceof ConnectException)
return new DownloadStatus(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_READ, NLS.bind(Messages.TransportErrorTranslator_UnableToConnectToRepository_0, toDownload), t);
if (t instanceof UnknownHostException)
diff --git a/bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/RepositoryTransport.java b/bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/RepositoryTransport.java
index 9db59789b..eb87f3097 100644
--- a/bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/RepositoryTransport.java
+++ b/bundles/org.eclipse.equinox.p2.transport.ecf/src/org/eclipse/equinox/internal/p2/transport/ecf/RepositoryTransport.java
@@ -298,6 +298,8 @@ public class RepositoryTransport extends Transport {
}
if (t instanceof FileNotFoundException || (t instanceof IncomingFileTransferException && ((IncomingFileTransferException) t).getErrorCode() == 404))
return new DownloadStatus(IStatus.ERROR, Activator.ID, ProvisionException.ARTIFACT_NOT_FOUND, NLS.bind(Messages.artifact_not_found, toDownload), t);
+ if (t.getClass().getName().equals("org.apache.http.conn.HttpHostConnectException"))
+ return new DownloadStatus(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_INVALID_LOCATION, NLS.bind(Messages.TransportErrorTranslator_UnknownHost, toDownload), t);
if (t instanceof ConnectException)
return new DownloadStatus(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_READ, NLS.bind(Messages.TransportErrorTranslator_UnableToConnectToRepository_0, toDownload), t);
if (t instanceof UnknownHostException)

Back to the top