Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2015-12-12 04:35:34 -0500
committerEike Stepper2015-12-12 04:35:34 -0500
commit0132a84f5b511f4594f4ca0b3e57af6cc18b582b (patch)
tree44e1a4daa2be3aca226a82b5cb7f3dcd0ba1f530
parent7327dc04e9bea2c488fbfa8dce3a5d175b7a1b59 (diff)
downloaduss-0132a84f5b511f4594f4ca0b3e57af6cc18b582b.tar.gz
uss-0132a84f5b511f4594f4ca0b3e57af6cc18b582b.tar.xz
uss-0132a84f5b511f4594f4ca0b3e57af6cc18b582b.zip
Add support for -Dorg.eclipse.userstorage.quietSecureStorageException
-rw-r--r--org.eclipse.userstorage/src/org/eclipse/userstorage/internal/StorageService.java22
1 files changed, 17 insertions, 5 deletions
diff --git a/org.eclipse.userstorage/src/org/eclipse/userstorage/internal/StorageService.java b/org.eclipse.userstorage/src/org/eclipse/userstorage/internal/StorageService.java
index 20e17e6..ac7d126 100644
--- a/org.eclipse.userstorage/src/org/eclipse/userstorage/internal/StorageService.java
+++ b/org.eclipse.userstorage/src/org/eclipse/userstorage/internal/StorageService.java
@@ -36,6 +36,8 @@ public class StorageService implements IStorageService
private static final String TERMS_OF_USE_AGREED_KEY = "termsOfUseAgreed";
+ private static final boolean QUIET_SECURE_STORAGE_EXCEPTION = Boolean.getBoolean("org.eclipse.userstorage.quietSecureStorageException");
+
private final Semaphore authenticationSemaphore = new Semaphore(1);
private final String serviceLabel;
@@ -144,7 +146,7 @@ public class StorageService implements IStorageService
}
catch (StorageException ex)
{
- Activator.log(ex);
+ logSecureStorageProblem(ex);
}
return null;
@@ -182,7 +184,7 @@ public class StorageService implements IStorageService
}
catch (Exception ex)
{
- Activator.log(ex);
+ logSecureStorageProblem(ex);
}
finally
{
@@ -207,9 +209,9 @@ public class StorageService implements IStorageService
}
}
}
- catch (StorageException ex)
+ catch (Exception ex)
{
- Activator.log(ex);
+ logSecureStorageProblem(ex);
}
return false;
@@ -236,7 +238,7 @@ public class StorageService implements IStorageService
}
catch (Exception ex)
{
- Activator.log(ex);
+ logSecureStorageProblem(ex);
}
finally
{
@@ -405,6 +407,16 @@ public class StorageService implements IStorageService
return new Session(this);
}
+ private static void logSecureStorageProblem(Exception ex)
+ {
+ if (QUIET_SECURE_STORAGE_EXCEPTION && ex instanceof StorageException)
+ {
+ return;
+ }
+
+ Activator.log(ex);
+ }
+
/**
* @author Eike Stepper
*/

Back to the top