From 23a35a0809fe67944c7cb11bbbbba2f0c96c2cdb Mon Sep 17 00:00:00 2001 From: kimchy Date: Sun, 10 Jul 2011 03:25:34 +0300 Subject: [PATCH] add handling a failure of malformed scroll id, and throw back the scroll id itself for simpler debugging --- .../action/search/type/TransportSearchHelper.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/action/search/type/TransportSearchHelper.java b/modules/elasticsearch/src/main/java/org/elasticsearch/action/search/type/TransportSearchHelper.java index ec6f04015b6..c48841513c4 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/action/search/type/TransportSearchHelper.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/action/search/type/TransportSearchHelper.java @@ -127,6 +127,9 @@ public abstract class TransportSearchHelper { for (int i = 0; i < contextSize; i++) { String element = elements[index++]; int sep = element.indexOf(':'); + if (sep == -1) { + throw new ElasticSearchIllegalArgumentException("Malformed scrollId [" + scrollId + "]"); + } context[i] = new Tuple(element.substring(sep + 1), Long.parseLong(element.substring(0, sep))); } Map attributes;