Add support for -Dorg.eclipse.userstorage.quietSecureStorageException
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 @@
 
   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 @@
     }
     catch (StorageException ex)
     {
-      Activator.log(ex);
+      logSecureStorageProblem(ex);
     }
 
     return null;
@@ -182,7 +184,7 @@
     }
     catch (Exception ex)
     {
-      Activator.log(ex);
+      logSecureStorageProblem(ex);
     }
     finally
     {
@@ -207,9 +209,9 @@
         }
       }
     }
-    catch (StorageException ex)
+    catch (Exception ex)
     {
-      Activator.log(ex);
+      logSecureStorageProblem(ex);
     }
 
     return false;
@@ -236,7 +238,7 @@
     }
     catch (Exception ex)
     {
-      Activator.log(ex);
+      logSecureStorageProblem(ex);
     }
     finally
     {
@@ -405,6 +407,16 @@
     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
    */