Merge "SO refactor - extract Workflow type Service Issue-ID: SO-3581"
authorLukasz Muszkieta <lukasz.muszkieta@nokia.com>
Tue, 30 Mar 2021 13:02:46 +0000 (13:02 +0000)
committerGerrit Code Review <gerrit@onap.org>
Tue, 30 Mar 2021 13:02:46 +0000 (13:02 +0000)
bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/MSOInfrastructureApplication.java

index 477dce1..8d6e133 100644 (file)
@@ -79,6 +79,7 @@ public class MSOInfrastructureApplication {
     private static final String LOGS_DIR = "logs_dir";
     private static final String BPMN_SUFFIX = ".bpmn";
     private static final String SDC_SOURCE = "sdc";
+    private static final int CANNOT_INVOKE_COMMAND = 126;
 
 
     private static void setLogsDir() {
@@ -88,9 +89,14 @@ public class MSOInfrastructureApplication {
     }
 
     public static void main(String... args) {
-        SpringApplication.run(MSOInfrastructureApplication.class, args);
-        System.getProperties().setProperty("mso.config.path", ".");
-        setLogsDir();
+        try {
+            SpringApplication.run(MSOInfrastructureApplication.class, args);
+            System.getProperties().setProperty("mso.config.path", ".");
+            setLogsDir();
+        } catch (Exception e) {
+            logger.error("Exception has occurred during application startup. App will exit. ", e);
+            System.exit(CANNOT_INVOKE_COMMAND);
+        }
     }
 
     @PostConstruct