summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--framework/src/main/java/org/onap/cli/fw/utils/OnapCommandUtils.java4
-rw-r--r--main/src/main/java/org/onap/cli/main/OnapCli.java11
2 files changed, 7 insertions, 8 deletions
diff --git a/framework/src/main/java/org/onap/cli/fw/utils/OnapCommandUtils.java b/framework/src/main/java/org/onap/cli/fw/utils/OnapCommandUtils.java
index bd910748..c5ebbc21 100644
--- a/framework/src/main/java/org/onap/cli/fw/utils/OnapCommandUtils.java
+++ b/framework/src/main/java/org/onap/cli/fw/utils/OnapCommandUtils.java
@@ -288,8 +288,8 @@ public class OnapCommandUtils {
for (String value: entry.getValue()) {
try {
value = replaceLineFromInputParameters(value, params);
- } catch(OnapCommandResultEmpty e) {
- // pass // NOSONAR
+ } catch(OnapCommandResultEmpty e) { // NOSONAR
+ // pass
}
resultsProcessed.get(key).add(value);
}
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();
}
}
}