Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2016-03-17 17:27:02 -0400
committerMatthias Sohn2016-03-21 20:48:04 -0400
commit036328293315dd2d1f6a8cc460c1446efd9da022 (patch)
tree1857a005249bd4273d0c20ca4c56115fe8da89a7
parent5ceb6c1e729be7dffd252acad4949944d111f009 (diff)
downloadegit-036328293315dd2d1f6a8cc460c1446efd9da022.tar.gz
egit-036328293315dd2d1f6a8cc460c1446efd9da022.tar.xz
egit-036328293315dd2d1f6a8cc460c1446efd9da022.zip
Do not swallow error in FetchGerritChangePage on finish
internalDoFetch() must not handle the error but propagate it. When called from the background job, the job must translate exceptions into an appropriate status. Then let the job framework handle notifying the user of the error. Bug: 489679 Change-Id: Ia2bcdf267a6d83dfa89b60f217b223e15fdc5e4e Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java23
1 files changed, 14 insertions, 9 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java
index 557d25465..db63296b1 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchGerritChangePage.java
@@ -659,10 +659,16 @@ public class FetchGerritChangePage extends WizardPage {
@Override
public IStatus runInWorkspace(IProgressMonitor monitor) {
- internalDoFetch(spec, uri, doCheckout, doCreateTag,
- doCreateBranch, doCheckoutNewBranch,
- doActivateAdditionalRefs,
- textForTag, textForBranch, monitor);
+ try {
+ internalDoFetch(spec, uri, doCheckout, doCreateTag,
+ doCreateBranch, doCheckoutNewBranch,
+ doActivateAdditionalRefs, textForTag,
+ textForBranch, monitor);
+ } catch (CoreException ce) {
+ return ce.getStatus();
+ } catch (Exception e) {
+ return Activator.createErrorStatus(e.getLocalizedMessage(), e);
+ }
return org.eclipse.core.runtime.Status.OK_STATUS;
}
@@ -712,9 +718,10 @@ public class FetchGerritChangePage extends WizardPage {
private void internalDoFetch(RefSpec spec, String uri, boolean doCheckout,
boolean doCreateTag, boolean doCreateBranch,
- boolean doCheckoutNewBranch,
- boolean doActivateAdditionalRefs, String textForTag,
- String textForBranch, IProgressMonitor monitor) {
+ boolean doCheckoutNewBranch, boolean doActivateAdditionalRefs,
+ String textForTag, String textForBranch, IProgressMonitor monitor)
+ throws IOException, CoreException, URISyntaxException,
+ GitAPIException {
int totalWork = 1;
if (doCheckout)
@@ -743,8 +750,6 @@ public class FetchGerritChangePage extends WizardPage {
storeLastUsedUri(uri);
- } catch (Exception e) {
- Activator.handleError(e.getMessage(), e, true);
} finally {
monitor.done();
}

Back to the top