]> git.mxchange.org Git - jaddressbook-lib.git/blobdiff - Addressbook/src/org/mxchange/addressbook/manager/contact/AddressbookContactManager.java
Fixes for missing throws statements (because jcore has changed).
[jaddressbook-lib.git] / Addressbook / src / org / mxchange / addressbook / manager / contact / AddressbookContactManager.java
index b85e9d3690c070435aec0cd530f344b3a095995c..980c64b69490f047bb9727a651d8f1e6965ef889 100644 (file)
@@ -16,6 +16,8 @@
  */
 package org.mxchange.addressbook.manager.contact;
 
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
 import java.sql.SQLException;
 import java.text.MessageFormat;
 import java.util.ArrayList;
@@ -31,6 +33,7 @@ import org.mxchange.jcore.contact.Contact;
 import org.mxchange.jcore.contact.Gender;
 import org.mxchange.jcore.exceptions.BadTokenException;
 import org.mxchange.jcore.exceptions.UnhandledUserChoiceException;
+import org.mxchange.jcore.exceptions.UnsupportedDatabaseBackendException;
 import org.mxchange.jcore.manager.BaseManager;
 
 /**
@@ -61,8 +64,10 @@ public class AddressbookContactManager extends BaseManager implements Manageable
         * a client instance.
         *
         * @param client Client instance to use
+        * @throws org.mxchange.jcore.exceptions.UnsupportedDatabaseBackendException If the database backend is not supported
+        * @throws java.sql.SQLException If an SQL error occurs
         */
-       public AddressbookContactManager (final Client client) {
+       public AddressbookContactManager (final Client client) throws UnsupportedDatabaseBackendException, SQLException {
                // Trace message
                this.getLogger().trace(MessageFormat.format("client={1} - CALLED!", client)); //NOI18N
 
@@ -327,9 +332,12 @@ public class AddressbookContactManager extends BaseManager implements Manageable
 
        /**
         * Shuts down this contact manager
+        * 
+        * @throws java.sql.SQLException If an SQL error occurs
+        * @throws java.io.IOException If an IO error occurs
         */
        @Override
-       public void doShutdown () {
+       public void doShutdown () throws SQLException, IOException {
                // Trace message
                this.getLogger().trace("CALLED!"); //NOI18N
 
@@ -615,7 +623,12 @@ public class AddressbookContactManager extends BaseManager implements Manageable
                this.getLogger().debug(MessageFormat.format("columnName={0}", columnName));
 
                // Now get that column
-               Object value = contact.getValueFromColumn(columnName);
+               Object value = null;
+               try {
+                       value = contact.getValueFromColumn(columnName);
+               } catch (final IllegalArgumentException | NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) {
+                       this.abortProgramWithException(ex);
+               }
 
                // Trace message
                this.getLogger().trace(MessageFormat.format("value={0} - EXIT!", value));
@@ -641,7 +654,7 @@ public class AddressbookContactManager extends BaseManager implements Manageable
                try {
                        // Deligate this call to frontend
                        isAdded = this.getContactDatabase().isOwnContactFound();
-               } catch (final SQLException ex) {
+               } catch (final SQLException | IOException | BadTokenException ex) {
                        // Something bad happened
                        this.abortProgramWithException(ex);
                }