diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2019-01-21 23:19:32 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2019-01-21 23:19:55 +0100 |
commit | ec7ec69819f56a1c4f09a6d7f70eea090035e19b (patch) | |
tree | 12a5a63508c6382f769047844153e58f18909b88 /org.eclipse.jgit.pgm | |
parent | d8fec824e4f81dbae5bb72046560452cd19b319d (diff) | |
download | jgit-ec7ec69819f56a1c4f09a6d7f70eea090035e19b.tar.gz jgit-ec7ec69819f56a1c4f09a6d7f70eea090035e19b.zip |
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>
Diffstat (limited to 'org.eclipse.jgit.pgm')
-rw-r--r-- | org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Remote.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Remote.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Remote.java index efd61fae16..58138fa03b 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Remote.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Remote.java @@ -87,7 +87,7 @@ class Remote extends TextBuiltin { /** {@inheritDoc} */ @Override - protected void run() throws Exception { + protected void run() { try (Git git = new Git(db)) { if (command == null) { RemoteListCommand cmd = git.remoteList(); @@ -142,6 +142,8 @@ class Remote extends TextBuiltin { throw new JGitInternalException(MessageFormat .format(CLIText.get().unknownSubcommand, command)); } + } catch (Exception e) { + throw die(e.getMessage(), e); } } |