remote: change key exception handlig so not to use java.rmi, which is 'not good enoug...
[fanfix.git] / src / be / nikiroo / fanfix / library / RemoteLibrary.java
index 4d8d5123bc787bcf65167bc29dd2d8d840200083..a6c68546882c0cdd64bda6c7592976d228bdfb4d 100644 (file)
@@ -41,12 +41,7 @@ public class RemoteLibrary extends BasicLibrary {
                        Object rep = super.send(data);
                        if (rep instanceof RemoteLibraryException) {
                                RemoteLibraryException remoteEx = (RemoteLibraryException) rep;
-                               IOException cause = remoteEx.getCause();
-                               if (cause == null) {
-                                       cause = new IOException("IOException");
-                               }
-
-                               throw cause;
+                               throw remoteEx.unwrapException();
                        }
 
                        return rep;
@@ -446,6 +441,9 @@ public class RemoteLibrary extends BasicLibrary {
 
        /**
         * Stop the server.
+        * 
+        * @throws IOException
+        *             in case of I/O error (including bad key)
         */
        public void exit() throws IOException {
                connectRemoteAction(new RemoteAction() {