From 7a64771b9e761ef37c8ab0a29ffe03d29b688ec4 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Sun, 20 Jan 2019 21:19:53 +0100 Subject: [PATCH] pgm: Handle IOException 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: If8be68621c7135435cd067ef638460b175786b1b Signed-off-by: Matthias Sohn --- org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java | 4 ++-- 1 file changed, 2 insertions(+), 2 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 846879388e..f29740d8a0 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 @@ -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); } } -- 2.39.5