From 2af6f3fbff4af7aabcb6644659dfa1b38b12ab5e Mon Sep 17 00:00:00 2001 From: xuzha Date: Fri, 21 Aug 2015 01:16:38 -0700 Subject: [PATCH] Print field name when meet unexpected token. closes #12391 --- .../bucket/range/geodistance/GeoDistanceParser.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/range/geodistance/GeoDistanceParser.java b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/range/geodistance/GeoDistanceParser.java index afe3acf0a19..e110cc17288 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/range/geodistance/GeoDistanceParser.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/range/geodistance/GeoDistanceParser.java @@ -145,8 +145,8 @@ public class GeoDistanceParser implements Aggregator.Parser { + currentFieldName + "].", parser.getTokenLocation()); } } else { - throw new SearchParseException(context, "Unexpected token " + token + " in [" + aggregationName + "].", - parser.getTokenLocation()); + throw new SearchParseException(context, "Unexpected token " + token + " in [" + aggregationName + "]: [" + + currentFieldName + "].", parser.getTokenLocation()); } }