update nikiroo-utils, remote lib errors need some work
[fanfix.git] / src / be / nikiroo / fanfix / library / RemoteLibraryServer.java
index f623163411f9c2a2e1f781039a67518199da75a9..0893746239292297aeb1091aa51780351288b749 100644 (file)
@@ -6,6 +6,8 @@ import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
+import javax.net.ssl.SSLException;
+
 import be.nikiroo.fanfix.Instance;
 import be.nikiroo.fanfix.data.Chapter;
 import be.nikiroo.fanfix.data.MetaData;
@@ -14,7 +16,6 @@ import be.nikiroo.fanfix.data.Story;
 import be.nikiroo.utils.Progress;
 import be.nikiroo.utils.Progress.ProgressListener;
 import be.nikiroo.utils.StringUtils;
-import be.nikiroo.utils.Version;
 import be.nikiroo.utils.serial.server.ConnectActionServerObject;
 import be.nikiroo.utils.serial.server.ServerObject;
 
@@ -63,13 +64,12 @@ public class RemoteLibraryServer extends ServerObject {
         */
        public RemoteLibraryServer(String key, int port) throws IOException {
                super("Fanfix remote library", port, key);
-
                setTraceHandler(Instance.getTraceHandler());
        }
 
        @Override
-       protected Object onRequest(ConnectActionServerObject action,
-                       Version clientVersion, Object data) throws Exception {
+       protected Object onRequest(ConnectActionServerObject action, Object data)
+                       throws Exception {
                long start = new Date().getTime();
 
                String command = "";
@@ -201,7 +201,11 @@ public class RemoteLibraryServer extends ServerObject {
 
        @Override
        protected void onError(Exception e) {
-               getTraceHandler().error(e);
+               if (e instanceof SSLException) {
+                       System.out.println("[Client connection refused (bad key)]");
+               } else {
+                       getTraceHandler().error(e);
+               }
        }
 
        /**