summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorRenato Bertacco2011-09-30 10:20:06 (EDT)
committer Jens Baumgart2011-09-30 10:20:06 (EDT)
commit9953f30844f843a7dc57ac42468ea2106e12f873 (patch)
tree91e5eb3ef17e7e4eaa2ade01f5785bc78433f6a2
parentd206ba60d2f0496fb381a65a871c7d218fa80258 (diff)
downloadegit-9953f30844f843a7dc57ac42468ea2106e12f873.zip
egit-9953f30844f843a7dc57ac42468ea2106e12f873.tar.gz
egit-9953f30844f843a7dc57ac42468ea2106e12f873.tar.bz2
Unbox InvocationTargetException before throwing TeamExceptionrefs/changes/12/4312/3
Originally implementation of addToWorkspace method catches InvocationTargetException and throws a team exception without unboxing the original exception, therefore loosing details about the original problem on problem report dialog Bug 358534 Change-Id: I2ad63708219912bfaeb06b47ae09671a13345f80 Signed-off-by: Renato Bertacco <renato.bertacco@finantix.com>
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/GitProjectSetCapability.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/GitProjectSetCapability.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/GitProjectSetCapability.java
index 940db65..0e0a708 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/GitProjectSetCapability.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/GitProjectSetCapability.java
@@ -238,7 +238,7 @@ public final class GitProjectSetCapability extends ProjectSetCapability {
connectProviderOperation.execute(wsOpMonitor);
}
} catch (final InvocationTargetException e) {
- throw TeamException.asTeamException(e);
+ throwTeamException(e);
} catch (final CoreException e) {
throw TeamException.asTeamException(e);
} catch (final InterruptedException e) {
@@ -258,6 +258,14 @@ public final class GitProjectSetCapability extends ProjectSetCapability {
return result;
}
+ private TeamException throwTeamException(Throwable th) throws TeamException{
+ Throwable current = th;
+ while(current.getCause()!=null){
+ current = current.getCause();
+ }
+ throw new TeamException(current.getMessage(), current);
+ }
+
/**
* @param gitUrl
* @param branch the branch to check out