Updated Branches: refs/heads/trunk e50d89dd2 -> 542d9c8d1
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/trunk Commit: a301ea14293f046dc4ff10c84aaef192fbc70c0a Parents: 2b1fb0f Author: Sylvain Lebresne <sylv...@datastax.com> Authored: Mon Nov 18 15:53:42 2013 +0100 Committer: Sylvain Lebresne <sylv...@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).")); + } } };