Skip to content

Commit 4dcaf3b

Browse files
Handle all exceptions while accessing secure storage (#275)
1 parent 14d43de commit 4dcaf3b

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

org.abapgit.adt.ui/src/org/abapgit/adt/ui/internal/util/GitCredentialsService.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.abapgit.adt.ui.internal.util;
22

3-
import java.io.IOException;
43
import java.util.HashMap;
54
import java.util.Map;
65

@@ -16,7 +15,6 @@
1615
import org.eclipse.equinox.security.storage.EncodingUtils;
1716
import org.eclipse.equinox.security.storage.ISecurePreferences;
1817
import org.eclipse.equinox.security.storage.SecurePreferencesFactory;
19-
import org.eclipse.equinox.security.storage.StorageException;
2018
import org.eclipse.equinox.security.storage.provider.IProviderHints;
2119
import org.eclipse.jface.dialogs.Dialog;
2220
import org.eclipse.jface.dialogs.IDialogConstants;
@@ -145,7 +143,7 @@ public static void storeCredentialsInSecureStorage(IExternalRepositoryInfoReques
145143
node.put("password", repositoryCredentials.getPassword(), true); //$NON-NLS-1$
146144
}
147145
}
148-
} catch (IOException | StorageException e) {
146+
} catch (Exception e) {
149147
AbapGitUIPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, AbapGitUIPlugin.PLUGIN_ID, e.getMessage(), e));
150148
MessageDialog.openWarning(shell, "Eclipse secure storage error", getErrorMessage(e)); //$NON-NLS-1$
151149
GitCredentialsService.deleteCredentialsFromSecureStorage(repositoryURL); // if anything stored in the secure storage

org.abapgit.adt.ui/src/org/abapgit/adt/ui/internal/wizards/AbapGitWizardPageRepositoryAndCredentials.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import org.eclipse.core.runtime.Status;
2222
import org.eclipse.equinox.security.storage.ISecurePreferences;
2323
import org.eclipse.equinox.security.storage.SecurePreferencesFactory;
24-
import org.eclipse.equinox.security.storage.StorageException;
2524
import org.eclipse.jface.dialogs.DialogPage;
2625
import org.eclipse.jface.dialogs.TrayDialog;
2726
import org.eclipse.jface.operation.IRunnableWithProgress;
@@ -367,7 +366,7 @@ private static IExternalRepositoryInfoRequest getRepoCredentialsFromSecureStorag
367366
try {
368367
credentials.setUser(node.get("user", null)); //$NON-NLS-1$
369368
credentials.setPassword(node.get("password", null)); //$NON-NLS-1$
370-
} catch (StorageException e) {
369+
} catch (Exception e) {
371370
AbapGitUIPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, AbapGitUIPlugin.PLUGIN_ID, e.getMessage(), e));
372371
return null;
373372
}

0 commit comments

Comments
 (0)