aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2018-09-10 05:41:22 -0400
committerMatthias Sohn2018-09-10 15:50:17 -0400
commit81c42e3003c978cd66a4f2dbd9a95839f7e9efd5 (patch)
treefbc6dbe07e0de4e7aab4b4412096fb20a7ea79f9
parent1ed88470943a5b05033f0b4a9c42ab4ba11814ab (diff)
downloadegit-81c42e3003c978cd66a4f2dbd9a95839f7e9efd5.tar.gz
egit-81c42e3003c978cd66a4f2dbd9a95839f7e9efd5.tar.xz
egit-81c42e3003c978cd66a4f2dbd9a95839f7e9efd5.zip
Don't log an error on save in comparisons if resource out of sync
CompareEditorInput.saveChanges() also only displays a dialog if something goes wrong with saving. We cannot just let the exception propagate because this is also reachable via other code paths that do not appear to check for InvocationTargetException. So we need to handle it somehow. Do not log the error; just present an error to the user via the StatusManager. Bug: 538855 Change-Id: I03f0699f4641a9ba99815aad0869c0ef1d4c2a66 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/revision/ResourceEditableRevision.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/revision/ResourceEditableRevision.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/revision/ResourceEditableRevision.java
index d07adccdb..a1846775e 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/revision/ResourceEditableRevision.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/revision/ResourceEditableRevision.java
@@ -80,8 +80,13 @@ public class ResourceEditableRevision extends EditableRevision {
}
});
} catch (InvocationTargetException e) {
- Activator.handleError(e.getTargetException().getMessage(),
- e.getTargetException(), true);
+ if (e.getCause() instanceof CoreException) {
+ Activator.showErrorStatus(e.getCause().getLocalizedMessage(),
+ ((CoreException) e.getCause()).getStatus());
+ } else {
+ Activator.showError(e.getCause().getLocalizedMessage(),
+ e.getCause());
+ }
} catch (InterruptedException e) {
// ignore here
}