aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2019-01-21 00:47:26 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2019-01-21 00:54:10 +0100
commit8b15ff57c8b376f60ad40b0e41ba10395bcfbf5d (patch)
tree57bea74b3e81bb116ecf3e41e73fe5be3a20d8e0 /org.eclipse.jgit.pgm
parent152e4b43a3711f0da6fa5f7beb98129fc8b9e9c8 (diff)
downloadjgit-8b15ff57c8b376f60ad40b0e41ba10395bcfbf5d.tar.gz
jgit-8b15ff57c8b376f60ad40b0e41ba10395bcfbf5d.zip
pgm: Handle IOException in IndexPack 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: Ie8a8388daecb0500f04197462210606c42f143c1 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/IndexPack.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/IndexPack.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/IndexPack.java
index 26276718df..394083c851 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/IndexPack.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/IndexPack.java
@@ -45,6 +45,7 @@
package org.eclipse.jgit.pgm;
import java.io.BufferedInputStream;
+import java.io.IOException;
import org.eclipse.jgit.internal.storage.file.ObjectDirectoryPackParser;
import org.eclipse.jgit.lib.ObjectInserter;
@@ -62,7 +63,7 @@ class IndexPack extends TextBuiltin {
/** {@inheritDoc} */
@Override
- protected void run() throws Exception {
+ protected void run() {
BufferedInputStream in = new BufferedInputStream(ins);
try (ObjectInserter inserter = db.newObjectInserter()) {
PackParser p = inserter.newPackParser(in);
@@ -73,6 +74,8 @@ class IndexPack extends TextBuiltin {
}
p.parse(new TextProgressMonitor(errw));
inserter.flush();
+ } catch (IOException e) {
+ throw die(e.getMessage(), e);
}
}
}