pgm: Handle exceptions in Remote 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: Ie1985c2570213217c2ea0f376ff99d19bfed4e0c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
parent
d8fec824e4
commit
ec7ec69819
|
@ -87,7 +87,7 @@ class Remote extends TextBuiltin {
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
@Override
|
@Override
|
||||||
protected void run() throws Exception {
|
protected void run() {
|
||||||
try (Git git = new Git(db)) {
|
try (Git git = new Git(db)) {
|
||||||
if (command == null) {
|
if (command == null) {
|
||||||
RemoteListCommand cmd = git.remoteList();
|
RemoteListCommand cmd = git.remoteList();
|
||||||
|
@ -142,6 +142,8 @@ protected void run() throws Exception {
|
||||||
throw new JGitInternalException(MessageFormat
|
throw new JGitInternalException(MessageFormat
|
||||||
.format(CLIText.get().unknownSubcommand, command));
|
.format(CLIText.get().unknownSubcommand, command));
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw die(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue