-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
The service invoker does not return the error if a method that returns a CompletableFuture encounters an unhandled exception and never completes the future.
I saw this when the code below tried to deserialize the json and failed.
org.kinotic.structures.internal.api.services.sql.DefaultElasticVertxClient Line: 61
public CompletableFuture<TranslateResponse> translateSql(String statement,
List<?> params){
VertxCompletableFuture<TranslateResponse> responseFuture = new VertxCompletableFuture<>(vertx);
JsonObject json = new JsonObject().put("query", statement);
if(params != null) {
JsonArray paramsJson = new JsonArray();
for(Object param : params){
paramsJson.add(param);
}
json.put("params", paramsJson);
}
sqlTranslateRequest.sendJsonObject(json, ar -> {
if(ar.succeeded()){
TranslateResponse translateResponse = TranslateResponse.of(builder -> {
builder.withJson(new ByteArrayInputStream(ar.result()
.body()
.getBytes()));
return builder;
});
responseFuture.complete(translateResponse);
}else{
responseFuture.completeExceptionally(ar.cause());
}
});
return responseFuture;
}
```
Metadata
Metadata
Assignees
Labels
No labels