]> git.mxchange.org Git - addressbook-swing.git/commitdiff
Added more thrown exceptions or catch them.
authorRoland Haeder <roland@mxchange.org>
Wed, 12 Aug 2015 18:18:03 +0000 (20:18 +0200)
committerRoland Haeder <roland@mxchange.org>
Wed, 12 Aug 2015 18:18:03 +0000 (20:18 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

Addressbook/src/org/mxchange/addressbook/client/console/ConsoleClient.java
Addressbook/src/org/mxchange/addressbook/client/gui/AddressbookFrame.java
Addressbook/src/org/mxchange/addressbook/database/frontend/contact/AddressbookContactDatabaseFrontend.java

index 04f70379db31f321e8694349d84e03f83ce46861..a94762045c126963ada0e4bc4524c7c924c1f4c8 100644 (file)
@@ -378,8 +378,14 @@ public class ConsoleClient extends BaseAddressbookClient implements AddressbookC
                                manager.doDeleteOtherAddress();
                                break;
 
-                       case '0': // Program exit
+                       case '0': {
+                       try {
+                               // Program exit
                                this.getApplication().doShutdown();
+                       } catch (final SQLException | IOException ex) {
+                               this.abortProgramWithException(ex);
+                       }
+               }
                                break;
 
                        default:
index 4459773dd4342b0c51fad8fa03ed22a1a5df7c57..8661516a33c291bb518c748640fc96a2fb212853 100644 (file)
@@ -24,6 +24,8 @@ import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
 import java.awt.event.WindowAdapter;
 import java.awt.event.WindowEvent;
+import java.io.IOException;
+import java.sql.SQLException;
 import java.text.MessageFormat;
 import javax.swing.BorderFactory;
 import javax.swing.BoxLayout;
@@ -293,7 +295,12 @@ public class AddressbookFrame extends BaseAddressbookSystem implements ClientFra
                }
 
                // Call shutdown method
-               this.getClient().getApplication().doShutdown();
+               try {
+                       this.getClient().getApplication().doShutdown();
+               } catch (final SQLException | IOException ex) {
+                       // Abort here
+                       this.abortProgramWithException(ex);
+               }
 
                // Trace message
                this.getLogger().trace("EXIT!"); //NOI18N
index 25e2bf87b52a5607f8e320beca802a7b9baaef6b..2b93bf8d536e209a6877293a001ecd7343536722 100644 (file)
@@ -122,7 +122,7 @@ public class AddressbookContactDatabaseFrontend extends BaseDatabaseFrontend imp
         * Shuts down the database layer
         */
        @Override
-       public void doShutdown () {
+       public void doShutdown () throws SQLException, IOException {
                // Trace message
                this.getLogger().trace("CALLED!"); //NOI18N