Skip to content

Commit

Permalink
log actual error
Browse files Browse the repository at this point in the history
  • Loading branch information
ywangd committed Oct 8, 2024
1 parent e7fea24 commit 10ae254
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import org.elasticsearch.common.util.concurrent.UncategorizedExecutionException;
import org.elasticsearch.core.Nullable;
import org.elasticsearch.core.TimeValue;
import org.elasticsearch.logging.LogManager;
import org.elasticsearch.logging.Logger;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.Transports;

Expand All @@ -32,14 +34,21 @@

public class PlainActionFuture<T> implements ActionFuture<T>, ActionListener<T> {

private static final Logger logger = LogManager.getLogger(PlainActionFuture.class);

@Override
public void onResponse(@Nullable T result) {
set(result);
}

@Override
public void onFailure(Exception e) {
assert assertCompleteAllowed();
try {
assert assertCompleteAllowed();
} catch (AssertionError ae) {
logger.warn("--> AssertionError for onFailure", e);
throw ae;
}
if (sync.setException(Objects.requireNonNull(e))) {
done(false);
}
Expand Down

0 comments on commit 10ae254

Please sign in to comment.