Make exception message more descriptive

Exception message should be more descriptive about what to do when
inner_hit names colides.

Fixes https://github.com/elastic/elasticsearch/issues/19142
This commit is contained in:
Thiago Souza 2016-08-17 19:54:42 -03:00
parent f6b166f19e
commit 8e8614483b
1 changed files with 1 additions and 1 deletions

View File

@ -80,7 +80,7 @@ public final class InnerHitsContext {
public void addInnerHitDefinition(BaseInnerHits innerHit) {
if (innerHits.containsKey(innerHit.getName())) {
throw new IllegalArgumentException("inner_hit definition with the name [" + innerHit.getName() +
"] already exists. Use a different inner_hit name");
"] already exists. Use a different inner_hit name or define one explicitly");
}
innerHits.put(innerHit.getName(), innerHit);