Get more information logged in case something goes wrong

This commit is contained in:
Ralph Plawetzki 2020-10-07 18:55:18 +02:00
parent 667617b480
commit cae86cd71f
No known key found for this signature in database
GPG Key ID: 884A9D5F00094C9C
3 changed files with 11 additions and 6 deletions

View File

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

View File

@ -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);
}
}

View File

@ -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)