cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject git commit: Improve error message
Date Mon, 18 Nov 2013 14:54:06 GMT
Updated Branches:
  refs/heads/cassandra-1.2 2b1fb0ff4 -> a301ea142


Improve error message


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

Branch: refs/heads/cassandra-1.2
Commit: a301ea14293f046dc4ff10c84aaef192fbc70c0a
Parents: 2b1fb0f
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Mon Nov 18 15:53:42 2013 +0100
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Mon Nov 18 15:53:42 2013 +0100

----------------------------------------------------------------------
 src/java/org/apache/cassandra/dht/Murmur3Partitioner.java | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a301ea14/src/java/org/apache/cassandra/dht/Murmur3Partitioner.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/dht/Murmur3Partitioner.java b/src/java/org/apache/cassandra/dht/Murmur3Partitioner.java
index 502f5cc..fe1c24f 100644
--- a/src/java/org/apache/cassandra/dht/Murmur3Partitioner.java
+++ b/src/java/org/apache/cassandra/dht/Murmur3Partitioner.java
@@ -185,7 +185,14 @@ public class Murmur3Partitioner extends AbstractPartitioner<LongToken>
 
         public Token<Long> fromString(String string)
         {
-            return new LongToken(Long.valueOf(string));
+            try
+            {
+                return new LongToken(Long.valueOf(string));
+            }
+            catch (NumberFormatException e)
+            {
+                throw new IllegalArgumentException(String.format("Invalid token for Murmur3Partitioner.
Got %s but expected a long value (unsigned 8 bytes integer)."));
+            }
         }
     };
 


Mime
View raw message