]> source.dussan.org Git - jgit.git/commitdiff
pgm: Handle IOException in Fetch command 26/135426/1
authorMatthias Sohn <matthias.sohn@sap.com>
Sun, 20 Jan 2019 20:19:53 +0000 (21:19 +0100)
committerMatthias Sohn <matthias.sohn@sap.com>
Sun, 20 Jan 2019 21:18:41 +0000 (22:18 +0100)
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: If8be68621c7135435cd067ef638460b175786b1b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java

index 846879388e52180167ad6e934bbf91af04236b78..f29740d8a040bd587fb5c445b177173e6042b88e 100644 (file)
@@ -137,7 +137,7 @@ class Fetch extends AbstractFetchCommand implements FetchCommand.Callback {
 
        /** {@inheritDoc} */
        @Override
-       protected void run() throws Exception {
+       protected void run() {
                try (Git git = new Git(db)) {
                        FetchCommand fetch = git.fetch();
                        if (fsck != null)
@@ -169,7 +169,7 @@ class Fetch extends AbstractFetchCommand implements FetchCommand.Callback {
                                return;
 
                        showFetchResult(result);
-               } catch (GitAPIException e) {
+               } catch (GitAPIException | IOException e) {
                        throw die(e.getMessage(), e);
                }
        }