add handling a failure of malformed scroll id, and throw back the scroll id itself for simpler debugging

This commit is contained in:
kimchy 2011-07-10 03:25:34 +03:00
parent ca97e19cde
commit 23a35a0809
1 changed files with 3 additions and 0 deletions

View File

@ -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<String, Long>(element.substring(sep + 1), Long.parseLong(element.substring(0, sep)));
}
Map<String, String> attributes;