Skip to content

Commit 3223919

Browse files
committed
fix can't explain sql by Elasticsearch-SQL Site
1 parent e4f5d04 commit 3223919

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/org/elasticsearch/plugin/nlpcn/RestSqlAction.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import org.apache.logging.log4j.Logger;
55
import org.elasticsearch.client.internal.node.NodeClient;
66
import org.elasticsearch.rest.RestResponse;
7+
import org.elasticsearch.xcontent.XContentParseException;
78
import org.elasticsearch.xcontent.XContentParser;
89
import org.elasticsearch.xcontent.XContentType;
910
import org.elasticsearch.plugin.nlpcn.executors.ActionRequestRestExecuterFactory;
@@ -51,7 +52,7 @@ public List<Route> routes() {
5152
protected RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException {
5253
try (XContentParser parser = request.contentOrSourceParamParser()) {
5354
parser.mapStrings().forEach((k, v) -> request.params().putIfAbsent(k, v));
54-
} catch (IOException e) {
55+
} catch (XContentParseException e) {
5556
// LOGGER.warn("Please use json format params, like: {\"sql\":\"SELECT * FROM test\"}");
5657
}
5758

0 commit comments

Comments
 (0)