pgm: Handle GitAPIException 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: I043838143df7280351186ee1bcca4d1cc4832257
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
Matthias Sohn 2019-01-16 18:02:39 +01:00
parent be2ae1e103
commit fe52e2fb8e
1 changed files with 3 additions and 0 deletions

View File

@ -51,6 +51,7 @@
import org.eclipse.jgit.api.FetchCommand;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.SubmoduleConfig.FetchRecurseSubmodulesMode;
import org.eclipse.jgit.lib.TextProgressMonitor;
@ -168,6 +169,8 @@ protected void run() throws Exception {
return;
showFetchResult(result);
} catch (GitAPIException e) {
throw die(e.getMessage(), e);
}
}