From 2cbd6a5431cee9ecaac6803bbb093a994d8915e2 Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Wed, 13 Sep 2017 16:54:50 +0530 Subject: Print exception stack in dev mode CLI-14 Change-Id: I5df0d582e8c1885ac815e91af6d2536036143c34 Signed-off-by: Kanagaraj Manickam k00365106 --- main/src/main/java/org/onap/cli/main/OnapCli.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'main/src') 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) { -- cgit 1.2.3-korg