Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,8 @@ public Mapper parse(ParseContext context) throws IOException {
context.doc().add(field);
}
} catch (Exception e) {
throw new MapperParsingException("failed to parse [" + fieldType().name() + "]", e);
throw new MapperParsingException("failed to parse [" + fieldType().name() + "] of document with id '"
+ context.sourceToParse().id() + "'", e);
}
multiFields.parse(this, context);
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ public void testIgnoreMalformedOption() throws Exception {
.bytes());
} catch (MapperParsingException e) {
assertThat(e.getCause(), instanceOf(IllegalArgumentException.class));
assertThat(e.getMessage(), is("failed to parse [field2]"));
assertThat(e.getMessage(), is("failed to parse [field2] of document with id '1'"));
}

// Verify that the default is false
Expand All @@ -328,7 +328,7 @@ public void testIgnoreMalformedOption() throws Exception {
.bytes());
} catch (MapperParsingException e) {
assertThat(e.getCause(), instanceOf(IllegalArgumentException.class));
assertThat(e.getMessage(), is("failed to parse [field3]"));
assertThat(e.getMessage(), is("failed to parse [field3] of document with id '1'"));
}

// Unless the global ignore_malformed option is set to true
Expand All @@ -353,7 +353,7 @@ public void testIgnoreMalformedOption() throws Exception {
.bytes());
} catch (MapperParsingException e) {
assertThat(e.getCause(), instanceOf(IllegalArgumentException.class));
assertThat(e.getMessage(), is("failed to parse [field2]"));
assertThat(e.getMessage(), is("failed to parse [field2] of document with id '1'"));
}
}

Expand Down