Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2015-05-05 10:43:37 +0000
committerPascal Rapicault2016-01-02 21:37:54 +0000
commit2608885d67a3a99406a8cf1bc660241c3574dcfa (patch)
treeeede74565ebabede00dc799b91b5ef2ed20cd45d /bundles/org.eclipse.equinox.p2.repository/src/org/eclipse
parentd9057d09f6b96fd8b9988299d3eb5131f9a79a98 (diff)
downloadrt.equinox.p2-2608885d67a3a99406a8cf1bc660241c3574dcfa.tar.gz
rt.equinox.p2-2608885d67a3a99406a8cf1bc660241c3574dcfa.tar.xz
rt.equinox.p2-2608885d67a3a99406a8cf1bc660241c3574dcfa.zip
Bug 466249 - Propagate more exceptions to ease problem analysis
We often get problem reports with stack traces that "end" somewhere in p2 even though it's obvious from looking at these places that there was a causing exception. These causing exceptions are often not propagated with the new exception that p2 creates and throws. I'm not sure if that's on purpose or just an oversight. I've prepared a proposal to enhance these places and make it easier to analyze the problems that users report. Change-Id: Iaa53448c53c18301113b42dbe80558eccec49e8e Signed-off-by: Eike Stepper <stepper@esc-net.de>
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.repository/src/org/eclipse')
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/persistence/CompositeParser.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/CacheManager.java2
2 files changed, 7 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/persistence/CompositeParser.java b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/persistence/CompositeParser.java
index a112f8b86..02471aeed 100644
--- a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/persistence/CompositeParser.java
+++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/persistence/CompositeParser.java
@@ -188,9 +188,13 @@ public class CompositeParser extends XMLParser implements XMLConstants {
theState = repositoryHandler.getRepository();
}
} catch (SAXException e) {
- throw new IOException(e.getMessage());
+ IOException ioException = new IOException(e.getMessage());
+ ioException.initCause(e);
+ throw ioException;
} catch (ParserConfigurationException e) {
- throw new IOException(e.getMessage());
+ IOException ioException = new IOException(e.getMessage());
+ ioException.initCause(e);
+ throw ioException;
} finally {
stream.close();
}
diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/CacheManager.java b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/CacheManager.java
index 97c239d24..5cc681886 100644
--- a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/CacheManager.java
+++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/CacheManager.java
@@ -239,7 +239,7 @@ public class CacheManager {
if (status == null)
throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_NOT_FOUND, NLS.bind(Messages.CacheManager_FailedCommunicationWithRepo_0, repositoryLocation), e));
else if (status.getException() instanceof FileNotFoundException)
- throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_NOT_FOUND, status.getMessage(), null));
+ throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_NOT_FOUND, status.getMessage(), status.getException()));
throw new ProvisionException(status);
}

Back to the top