usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdun...@apache.org
Subject [1/3] usergrid git commit: Fix check for missing keyspace in Astayanax bad request exception
Date Fri, 28 Jul 2017 22:11:42 GMT
Repository: usergrid
Updated Branches:
  refs/heads/hotfix-20170728 436cb8046 -> ceba1fa44


Fix check for missing keyspace in Astayanax bad request exception


Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/57c55f00
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/57c55f00
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/57c55f00

Branch: refs/heads/hotfix-20170728
Commit: 57c55f0085dfae8741f9602d32da5c90f57411d9
Parents: 436cb80
Author: Mike Dunker <mdunker@google.com>
Authored: Fri Jul 28 14:04:49 2017 -0700
Committer: Mike Dunker <mdunker@google.com>
Committed: Fri Jul 28 14:04:49 2017 -0700

----------------------------------------------------------------------
 .../persistence/core/migration/util/AstayanxUtils.java      | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/57c55f00/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/util/AstayanxUtils.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/util/AstayanxUtils.java
b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/util/AstayanxUtils.java
index 7ae4748..d500c68 100644
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/util/AstayanxUtils.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/migration/util/AstayanxUtils.java
@@ -35,13 +35,10 @@ public class AstayanxUtils {
 
         if ( cassandraException instanceof BadRequestException ) {
 
-            //check if it's b/c the keyspace is missing, if so
-            final String message = cassandraException.getMessage();
-
-            //no op, just swallow
-            if(message.contains( "why:Keyspace" ) && message.contains( "does not
exist" )){
+            //check if it's b/c the keyspace is missing
+            if (((BadRequestException) cassandraException).isKeyspaceDoestNotExist()) {
                 return;
-            };
+            }
         }
 
        throw new RuntimeException( rethrowMessage, cassandraException );


Mime
View raw message