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:
parent
e65497ad09
commit
7a64771b9e
|
@ -137,7 +137,7 @@ void noRecurseSubmodules(@SuppressWarnings("unused")
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
@Override
|
@Override
|
||||||
protected void run() throws Exception {
|
protected void run() {
|
||||||
try (Git git = new Git(db)) {
|
try (Git git = new Git(db)) {
|
||||||
FetchCommand fetch = git.fetch();
|
FetchCommand fetch = git.fetch();
|
||||||
if (fsck != null)
|
if (fsck != null)
|
||||||
|
@ -169,7 +169,7 @@ protected void run() throws Exception {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
showFetchResult(result);
|
showFetchResult(result);
|
||||||
} catch (GitAPIException e) {
|
} catch (GitAPIException | IOException e) {
|
||||||
throw die(e.getMessage(), e);
|
throw die(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue