pgm: Handle exceptions in Log 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: Ibca80cf2195db01298f2b95f507cfa3de2f403e7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
Matthias Sohn 2019-01-20 21:29:37 +01:00
parent 2d7806da31
commit 64386cbfb7
1 changed files with 3 additions and 1 deletions

View File

@ -193,7 +193,7 @@ protected void init(Repository repository, String gitDir) {
/** {@inheritDoc} */
@Override
protected void run() throws Exception {
protected void run() {
diffFmt.setRepository(db);
try {
diffFmt.setPathFilter(pathFilter);
@ -225,6 +225,8 @@ protected void run() throws Exception {
.getAllRefsByPeeledObjectId();
super.run();
} catch (Exception e) {
throw die(e.getMessage(), e);
} finally {
diffFmt.close();
}