Skip to content

Commit 3e67095

Browse files
More string & error handling improvements (microsoft#186183)
1 parent adafd26 commit 3e67095

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/vs/platform/encryption/electron-main/encryptionMainService.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,15 @@ export class EncryptionMainService implements IEncryptionMainService {
2626
) { }
2727

2828
async encrypt(value: string): Promise<string> {
29-
return JSON.stringify(safeStorage.encryptString(value));
29+
try {
30+
this.logService.trace('[EncryptionMainService] Encrypting value.');
31+
const result = JSON.stringify(safeStorage.encryptString(value));
32+
this.logService.trace('[EncryptionMainService] Encrypted value.');
33+
return result;
34+
} catch (e) {
35+
this.logService.error(e);
36+
throw e;
37+
}
3038
}
3139

3240
async decrypt(value: string): Promise<string> {

src/vs/platform/secrets/electron-sandbox/secretStorageService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ export class NativeSecretStorageService extends BaseSecretStorageService {
6262

6363
const provider = await this._encryptionService.getKeyStorageProvider();
6464
if (isGnome(provider)) {
65-
errorMessage = localize('isGnome', "You're running in a GNOME environment but encryption is not available. Ensure you have gnome-keyring or another libsecret compatible implementation installed and running.");
65+
errorMessage = localize('isGnome', "You're running in a GNOME environment but the OS keyring is not available for encryption. Ensure you have gnome-keyring or another libsecret compatible implementation installed and running.");
6666
} else if (isKwallet(provider)) {
67-
errorMessage = localize('isKwallet', "You're running in a KDE environment but encryption is not available. Ensure you have kwallet running.");
67+
errorMessage = localize('isKwallet', "You're running in a KDE environment but the OS keyring is not available for encryption. Ensure you have kwallet running.");
6868
} else if (provider === KnownStorageProvider.basicText) {
6969
errorMessage += ' ' + localize('usePlainTextExtraSentence', "Open the troubleshooting guide to address this or you can use weaker encryption that doesn't use the OS keyring.");
7070
const usePlainTextButton: IPromptChoice = {

0 commit comments

Comments
 (0)