aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2018-02-12 13:28:06 +0530
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2018-02-12 13:34:10 +0530
commit7ed67d67439e5945302bbab030a9627193de6616 (patch)
treed4098b4fe037fd266d74e6e039d18deda2b5ed91 /main
parent3984f88cab86fb89c0b5a6200730855eade5360e (diff)
Handle CLI warning effectivelyv2.0.0
Issue-ID: CLI-92 Change-Id: If5ce9499763fdec5980c4cdd1839d5ef31ccdd49 Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Diffstat (limited to 'main')
-rw-r--r--main/src/main/java/org/onap/cli/main/OnapCli.java11
1 files changed, 5 insertions, 6 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 62b78fd5..b8af6f51 100644
--- a/main/src/main/java/org/onap/cli/main/OnapCli.java
+++ b/main/src/main/java/org/onap/cli/main/OnapCli.java
@@ -376,14 +376,13 @@ public class OnapCli {
this.exitSuccessfully();
generateSmapleYaml(cmd);
+ } catch (OnapCommandWarning w) {
+ this.print(cmd.getResult().getDebugInfo());
+ this.exitSuccessfully();
} catch (Exception e) {
+ this.print(e);
this.print(cmd.getResult().getDebugInfo());
- if (e instanceof OnapCommandWarning) {
- this.exitSuccessfully();
- } else {
- this.print(e);
- this.exitFailure();
- }
+ this.exitFailure();
}
}
}