mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-25 14:26:27 +00:00
BulkItemResponse returns status code instead of status name
In commit fafeb3a, we've refactored REST response handling logic and returned HTTP status names instead of HTTP status codes for bulk item responses. With this commit we restore the original behavior. Checked with @bleskes.
This commit is contained in:
parent
90ff1ad5fb
commit
f5d307e426
@ -51,12 +51,12 @@ public class BulkItemResponse implements Streamable, StatusToXContent {
|
||||
builder.startObject(opType);
|
||||
if (failure == null) {
|
||||
response.toXContent(builder, params);
|
||||
builder.field(Fields.STATUS, response.status());
|
||||
builder.field(Fields.STATUS, response.status().getStatus());
|
||||
} else {
|
||||
builder.field(Fields._INDEX, failure.getIndex());
|
||||
builder.field(Fields._TYPE, failure.getType());
|
||||
builder.field(Fields._ID, failure.getId());
|
||||
builder.field(Fields.STATUS, failure.getStatus());
|
||||
builder.field(Fields.STATUS, failure.getStatus().getStatus());
|
||||
builder.startObject(Fields.ERROR);
|
||||
ElasticsearchException.toXContent(builder, params, failure.getCause());
|
||||
builder.endObject();
|
||||
|
Loading…
x
Reference in New Issue
Block a user