diff options
author | Thomas Wolf | 2016-03-17 21:27:02 +0000 |
---|---|---|
committer | Matthias Sohn | 2016-03-22 00:48:04 +0000 |
commit | 036328293315dd2d1f6a8cc460c1446efd9da022 (patch) | |
tree | 1857a005249bd4273d0c20ca4c56115fe8da89a7 | |
parent | 5ceb6c1e729be7dffd252acad4949944d111f009 (diff) | |
download | egit-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.java | 23 |
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 557d254659..db63296b14 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(); } |