Browse Source

Get more information logged in case something goes wrong

Ralph Plawetzki 4 years ago
parent
commit
cae86cd71f

+ 1 - 1
main/keychain/src/main/java/org/cryptomator/keychain/KeychainAccessStrategy.java

@@ -5,7 +5,7 @@
  *******************************************************************************/
 package org.cryptomator.keychain;
 
-interface KeychainAccessStrategy {
+public interface KeychainAccessStrategy {
 
 	/**
 	 * Associates a passphrase with a given key.

+ 9 - 4
main/keychain/src/main/java/org/cryptomator/keychain/LinuxKDEWalletKeychainAccessImpl.java

@@ -18,11 +18,12 @@ public class LinuxKDEWalletKeychainAccessImpl implements KeychainAccessStrategy
     private KDEWallet wallet;
     private int handle = -1;
 
-    public LinuxKDEWalletKeychainAccessImpl() {
+    public LinuxKDEWalletKeychainAccessImpl() throws KeychainAccessException {
         try {
             connection = DBusConnection.getConnection(DBusConnection.DBusBusType.SESSION);
         } catch (DBusException e) {
-            LOG.error(e.toString(), e.getCause());
+            LOG.error("Connecting to D-Bus failed:", e);
+            throw new KeychainAccessException(e);
         }
     }
 
@@ -32,7 +33,7 @@ public class LinuxKDEWalletKeychainAccessImpl implements KeychainAccessStrategy
             wallet = new KDEWallet(connection);
             return wallet.isEnabled();
         } catch (Exception e) {
-            LOG.error(e.toString(), e.getCause());
+            LOG.error("A KDEWallet could not be created:", e);
             return false;
         }
     }
@@ -49,7 +50,7 @@ public class LinuxKDEWalletKeychainAccessImpl implements KeychainAccessStrategy
                 LOG.debug("Passphrase was not stored.");
             }
         } catch (Exception e) {
-            LOG.error(e.toString(), e.getCause());
+            LOG.error("Storing the passphrase failed:", e);
             throw new KeychainAccessException(e);
         }
     }
@@ -66,6 +67,7 @@ public class LinuxKDEWalletKeychainAccessImpl implements KeychainAccessStrategy
             }
             return (password.equals("")) ? null : password.toCharArray();
         } catch (Exception e) {
+            LOG.error("Loading the passphrase failed:", e);
             throw new KeychainAccessException(e);
         }
     }
@@ -82,6 +84,7 @@ public class LinuxKDEWalletKeychainAccessImpl implements KeychainAccessStrategy
                 LOG.debug("Passphrase was not deleted.");
             }
         } catch (Exception e) {
+            LOG.error("Deleting the passphrase failed:", e);
             throw new KeychainAccessException(e);
         }
     }
@@ -98,6 +101,7 @@ public class LinuxKDEWalletKeychainAccessImpl implements KeychainAccessStrategy
                 LOG.debug("Passphrase could not be changed.");
             }
         } catch (Exception e) {
+            LOG.error("Changing the passphrase failed:", e);
             throw new KeychainAccessException(e);
         }
     }
@@ -115,6 +119,7 @@ public class LinuxKDEWalletKeychainAccessImpl implements KeychainAccessStrategy
             LOG.debug("Wallet successfully initialized.");
             return handle != -1;
         } catch (Exception e) {
+            LOG.error("Asynchronous opening the wallet failed:", e);
             throw new KeychainAccessException(e);
         }
     }

+ 1 - 1
main/ui/src/main/resources/license/THIRD-PARTY.txt

@@ -82,7 +82,7 @@ Cryptomator uses 53 third-party dependencies under the following licenses:
 		- zxcvbn4j (com.nulab-inc:zxcvbn:1.3.0 - https://github.com/nulab/zxcvbn4j)
 		- secret-service (de.swiesend:secret-service:1.1.0 - https://github.com/swiesend/secret-service)
 		- Checker Qual (org.checkerframework:checker-qual:2.11.1 - https://checkerframework.org)
-		- kdewallet (org.purejava:kdewallet:1.0.1 - https://github.com/purejava/kdewallet)
+		- kdewallet (org.purejava:kdewallet:1.1.1 - https://github.com/purejava/kdewallet)
 		- SLF4J API Module (org.slf4j:slf4j-api:1.7.30 - http://www.slf4j.org)
 	The BSD 2-Clause License:
 		- EasyBind (com.tobiasdiez:easybind:2.1.0 - https://github.com/tobiasdiez/EasyBind)