diff options
author | Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com> | 2017-09-13 16:54:50 +0530 |
---|---|---|
committer | Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com> | 2017-09-13 17:06:22 +0530 |
commit | 2cbd6a5431cee9ecaac6803bbb093a994d8915e2 (patch) | |
tree | b065d829e74add665a8345a4395f211f6bf92114 /main/src | |
parent | bb9a334dc4ab33a90533fc5d35508db3edfa34b6 (diff) |
Print exception stack in dev mode
CLI-14
Change-Id: I5df0d582e8c1885ac815e91af6d2536036143c34
Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Diffstat (limited to 'main/src')
-rw-r--r-- | main/src/main/java/org/onap/cli/main/OnapCli.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/main/src/main/java/org/onap/cli/main/OnapCli.java b/main/src/main/java/org/onap/cli/main/OnapCli.java index 8a4ebeb1..36db86c3 100644 --- a/main/src/main/java/org/onap/cli/main/OnapCli.java +++ b/main/src/main/java/org/onap/cli/main/OnapCli.java @@ -69,6 +69,13 @@ public class OnapCli { private void print(Throwable throwable) { System.out.println(throwable.getMessage()); + try { + if (OnapCommandRegistrar.getRegistrar().isDevMode()) { + throwable.printStackTrace(); + } + } catch (OnapCommandException e) { + // NOSONAR + } } private String getShortOption(String opt) { |