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 <matthias.sohn@sap.com>
This commit is contained in:
Matthias Sohn 2019-01-20 21:19:53 +01:00
parent e65497ad09
commit 7a64771b9e
1 changed files with 2 additions and 2 deletions

View File

@ -137,7 +137,7 @@ void noRecurseSubmodules(@SuppressWarnings("unused")
/** {@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 @@ protected void run() throws Exception {
return;
showFetchResult(result);
} catch (GitAPIException e) {
} catch (GitAPIException | IOException e) {
throw die(e.getMessage(), e);
}
}