aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Baumgart2010-02-16 07:57:48 (EST)
committerMatthias Sohn2010-02-16 19:58:55 (EST)
commit12172bcd4b9aa98b423bcfb5eab3940e63e53a97 (patch)
tree404bd51b31c5b01e4c8fdfe1594c7c23b9a17f87
parent44ab43de5eaeb1d5b2af3996af3a51c464e211d6 (diff)
downloadegit-12172bcd4b9aa98b423bcfb5eab3940e63e53a97.zip
egit-12172bcd4b9aa98b423bcfb5eab3940e63e53a97.tar.gz
egit-12172bcd4b9aa98b423bcfb5eab3940e63e53a97.tar.bz2
Fix error handling in Add to Version Control action.refs/changes/08/308/2
Executing Add to Version Control on a resource out of sync with the file system resulted in an empty error dialog. The error handling was corrected. Bug: 297979 Change-Id: I72f4b149b30165477ba595c3c90bf14f2dcd9760 Signed-off-by: Jens Baumgart <jens.baumgart@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIText.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/Track.java10
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties2
3 files changed, 14 insertions, 4 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIText.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIText.java
index 8212cee..6b8943f 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIText.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIText.java
@@ -1091,6 +1091,12 @@ public class UIText extends NLS {
/** */
public static String IgnoreAction_error;
+ /** */
+ public static String Track_error;
+
+ /** */
+ public static String Track_see_log;
+
static {
initializeMessages("org.eclipse.egit.ui.uitext", UIText.class); //$NON-NLS-1$
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/Track.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/Track.java
index fb6c681..1315e90 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/Track.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/Track.java
@@ -16,6 +16,8 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.egit.core.op.TrackOperation;
+import org.eclipse.egit.ui.Activator;
+import org.eclipse.egit.ui.UIText;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
@@ -40,15 +42,15 @@ public class Track extends RepositoryAction {
try {
op.run(arg0);
} catch (CoreException e) {
- MessageDialog.openError(getShell(),
- "Track failed", e.getMessage());
+ throw new InvocationTargetException(e);
}
}
});
} catch (InvocationTargetException e) {
- MessageDialog.openError(getShell(), "Track failed", e.getMessage());
+ Activator.logError(UIText.Track_error, e);
+ MessageDialog.openError(getShell(), UIText.Track_error, UIText.Track_see_log);
} catch (InterruptedException e) {
- MessageDialog.openError(getShell(), "Track failed", e.getMessage());
+ MessageDialog.openError(getShell(), UIText.Track_error, e.getMessage());
}
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties
index 50fdf11..a97316d 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties
@@ -398,3 +398,5 @@ Decorator_exceptionMessage=Errors occurred while applying Git decorations to res
IgnoreAction_jobName=Ignore Git resources
IgnoreAction_taskName=Ignoring Git resources
IgnoreAction_error=Unable to ignore resources
+Track_error=Add to Version Control failed
+Track_see_log=See error log for details.