diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2019-01-16 18:02:39 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2019-01-20 01:23:27 +0100 |
commit | fe52e2fb8ef447040014bbd9396bfe4a8e8315cf (patch) | |
tree | eae0b6da0e7dc6bff01919010af909c39cca4a8a /org.eclipse.jgit.pgm | |
parent | be2ae1e10342bef4a32b173079e97c08acb13169 (diff) | |
download | jgit-fe52e2fb8ef447040014bbd9396bfe4a8e8315cf.tar.gz jgit-fe52e2fb8ef447040014bbd9396bfe4a8e8315cf.zip |
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 <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.pgm')
-rw-r--r-- | org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java | 3 |
1 files changed, 3 insertions, 0 deletions
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); } } |