]> git.mxchange.org Git - jfinancials-lib.git/blobdiff - src/org/mxchange/addressbook/application/AddressbookApplication.java
Try to shutdown on unclean application start
[jfinancials-lib.git] / src / org / mxchange / addressbook / application / AddressbookApplication.java
index 21af4307ae90401fc7614eed849aa1eb913602b2..485e7a5b2c4797c280e5bc5f1cf4374e81d4eac0 100644 (file)
@@ -19,6 +19,8 @@ package org.mxchange.addressbook.application;
 import java.io.IOException;
 import java.sql.SQLException;
 import java.text.MessageFormat;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 import org.mxchange.addressbook.BaseAddressbookSystem;
 import org.mxchange.addressbook.client.AddressbookClient;
 import org.mxchange.addressbook.client.console.ConsoleClient;
@@ -165,7 +167,7 @@ public class AddressbookApplication extends BaseAddressbookSystem implements App
                this.getLogger().debug("Initializing application ..."); //NOI18N
 
                // Init client variable
-               Client client = null;
+               Client client;
 
                // Is console or Swing choosen?
                if (this.isConsole()) {
@@ -183,6 +185,14 @@ public class AddressbookApplication extends BaseAddressbookSystem implements App
                } else {
                        // Not client choosen
                        this.getLogger().error("No client choosen. Cannot launch."); //NOI18N
+                       try {
+                               this.doShutdown();
+                       } catch (final SQLException | IOException ex) {
+                               // Abort here
+                               this.abortProgramWithException(ex);
+                       }
+
+                       // Bye ...
                        System.exit(1);
                }