From d05cea20cf350850dc7bf923e3cd0bbbca4deb5e Mon Sep 17 00:00:00 2001 From: Robin Rosenberg Date: Sun, 10 Feb 2013 23:18:43 +0100 Subject: [PATCH] Show error to user if staging fails Just logging is not enough Bug 374695 Change-Id: I7db5417bcd86fbd3bbf0c1e4064130e8c54e2b99 Signed-off-by: Matthias Sohn --- .../org/eclipse/egit/ui/internal/staging/StagingView.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java index 0ad6b34d7..19e7387cb 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java @@ -97,6 +97,7 @@ import org.eclipse.jgit.api.AddCommand; import org.eclipse.jgit.api.CheckoutCommand; import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.RmCommand; +import org.eclipse.jgit.api.errors.JGitInternalException; import org.eclipse.jgit.api.errors.NoFilepatternException; import org.eclipse.jgit.dircache.DirCache; import org.eclipse.jgit.dircache.DirCacheEditor; @@ -1268,16 +1269,22 @@ public class StagingView extends ViewPart implements IShowInSource { add.call(); } catch (NoFilepatternException e1) { // cannot happen - } catch (Exception e2) { - Activator.error(e2.getMessage(), e2); + } catch (JGitInternalException e1) { + Activator.handleError(e1.getCause().getMessage(), + e1.getCause(), true); + } catch (Exception e1) { + Activator.handleError(e1.getMessage(), e1, true); } if (rm != null) try { rm.call(); } catch (NoFilepatternException e) { // cannot happen - } catch (Exception e2) { - Activator.error(e2.getMessage(), e2); + } catch (JGitInternalException e) { + Activator.handleError(e.getCause().getMessage(), e.getCause(), + true); + } catch (Exception e) { + Activator.handleError(e.getMessage(), e, true); } } -- 2.11.4.GIT