diff options
author | Jens Baumgart | 2010-02-16 12:57:48 +0000 |
---|---|---|
committer | Matthias Sohn | 2010-02-17 00:58:55 +0000 |
commit | 12172bcd4b9aa98b423bcfb5eab3940e63e53a97 (patch) | |
tree | 404bd51b31c5b01e4c8fdfe1594c7c23b9a17f87 | |
parent | 44ab43de5eaeb1d5b2af3996af3a51c464e211d6 (diff) | |
download | egit-12172bcd4b9aa98b423bcfb5eab3940e63e53a97.tar.gz egit-12172bcd4b9aa98b423bcfb5eab3940e63e53a97.tar.xz egit-12172bcd4b9aa98b423bcfb5eab3940e63e53a97.zip |
Fix error handling in Add to Version Control action.
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>
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 8212cee87a..6b8943f638 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 fb6c68129c..1315e90909 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 50fdf11c26..a97316dcbd 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. |