From fe52e2fb8ef447040014bbd9396bfe4a8e8315cf Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Wed, 16 Jan 2019 18:02:39 +0100 Subject: [PATCH] pgm: Handle GitAPIException in Fetch command This avoids we show a stacktrace on the console by default when this type of exception is thrown during the run method is executed. Change-Id: I043838143df7280351186ee1bcca4d1cc4832257 Signed-off-by: Matthias Sohn --- org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java index 61fd521b80..846879388e 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java @@ -51,6 +51,7 @@ import java.util.List; import org.eclipse.jgit.api.FetchCommand; import org.eclipse.jgit.api.Git; +import org.eclipse.jgit.api.errors.GitAPIException; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.SubmoduleConfig.FetchRecurseSubmodulesMode; import org.eclipse.jgit.lib.TextProgressMonitor; @@ -168,6 +169,8 @@ class Fetch extends AbstractFetchCommand implements FetchCommand.Callback { return; showFetchResult(result); + } catch (GitAPIException e) { + throw die(e.getMessage(), e); } } -- 2.39.5