You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, this is a normal behavior: if an incorrect json is passed to the withJson() method, it will throw a parsing exception (details depending on the json mapper that has been configured); thus, the code will never reach whenComplete(). A try catch clause should be used to handle this kind of situations.
Elasticsearch Version
java client 8.17.0
Installed Plugins
No response
Java Version
21
OS Version
win10
Problem Description
esClient.indices()
.create(b -> b.index(index).withJson(json))
.whenComplete((r, e) -> {
if (e != null) Log.error("[EsQuery]: create index $index failed", e);
Log.info("[EsQuery]: create index $index success");
}
As above, if I pass in a syntax incorrect JSON, whenComplete will not be executed.
Steps to Reproduce
esClient.indices()
.create(b -> b.index(index).withJson(json))
.whenComplete((r, e) -> {
if (e != null) Log.error("[EsQuery]: create index $index failed", e);
Log.info("[EsQuery]: create index $index success");
}
As above, if I pass in a syntax incorrect JSON, whenComplete will not be executed.
Logs (if relevant)
No response
The text was updated successfully, but these errors were encountered: