Use ElasticsearchException.generateThrowableXContent() and metadataToXContent() (elastic/elasticsearch#4655)

This is the x-pack siblings of elastic/elasticsearchelastic/elasticsearch#22611

Original commit: elastic/x-pack-elasticsearch@57924a6f1a
This commit is contained in:
Tanguy Leroux 2017-01-17 15:45:53 +01:00 committed by GitHub
parent 9e1f81d1e4
commit 06259f1836
2 changed files with 2 additions and 3 deletions

View File

@ -116,7 +116,7 @@ public class MonitoringBulkResponse extends ActionResponse {
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
builder.startObject();
ElasticsearchException.toXContent(builder, params, cause);
ElasticsearchException.generateThrowableXContent(builder, params, cause);
builder.endObject();
return builder;
}

View File

@ -61,8 +61,7 @@ public class ExportException extends ElasticsearchException implements Iterable<
}
@Override
protected void innerToXContent(XContentBuilder builder, Params params) throws IOException {
super.innerToXContent(builder, params);
protected void metadataToXContent(XContentBuilder builder, Params params) throws IOException {
if (hasExportExceptions()) {
builder.startArray("exceptions");
for (ExportException exception : exceptions) {