diff options
| author | Renato Bertacco | 2011-09-30 14:20:06 +0000 |
|---|---|---|
| committer | Jens Baumgart | 2011-09-30 14:20:06 +0000 |
| commit | 9953f30844f843a7dc57ac42468ea2106e12f873 (patch) | |
| tree | 91e5eb3ef17e7e4eaa2ade01f5785bc78433f6a2 | |
| parent | d206ba60d2f0496fb381a65a871c7d218fa80258 (diff) | |
| download | egit-9953f30844f843a7dc57ac42468ea2106e12f873.tar.gz egit-9953f30844f843a7dc57ac42468ea2106e12f873.tar.xz egit-9953f30844f843a7dc57ac42468ea2106e12f873.zip | |
Unbox InvocationTargetException before throwing TeamException
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.java | 10 |
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 940db65bc2..0e0a7084f3 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 |
