Skip to content

Commit

Permalink
Applying the changes introduced in #87504 to the ESQL code base (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas Wegmann committed Jun 22, 2022
1 parent f76d72c commit 80c1f5b
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.client.internal.node.NodeClient;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.BytesRestResponse;
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.RestResponse;
import org.elasticsearch.rest.RestStatus;
import org.elasticsearch.xcontent.XContentBuilder;
import org.elasticsearch.xcontent.XContentParser;
Expand Down Expand Up @@ -50,7 +50,7 @@ public void onResponse(EsqlQueryResponse esqlQueryResponse) {
try {
XContentBuilder builder = channel.newBuilder(request.getXContentType(), XContentType.JSON, true);
esqlQueryResponse.toXContent(builder, request);
channel.sendResponse(new BytesRestResponse(RestStatus.OK, builder));
channel.sendResponse(new RestResponse(RestStatus.OK, builder));
} catch (Exception e) {
onFailure(e);
}
Expand All @@ -59,7 +59,7 @@ public void onResponse(EsqlQueryResponse esqlQueryResponse) {
@Override
public void onFailure(Exception e) {
try {
channel.sendResponse(new BytesRestResponse(channel, e));
channel.sendResponse(new RestResponse(channel, e));
} catch (Exception inner) {
inner.addSuppressed(e);
logger.error("failed to send failure response", inner);
Expand Down

0 comments on commit 80c1f5b

Please sign in to comment.