diff --git a/vertx-sql-client/src/main/java/io/vertx/sqlclient/impl/pool/SqlConnectionPool.java b/vertx-sql-client/src/main/java/io/vertx/sqlclient/impl/pool/SqlConnectionPool.java index 9ae5b112a..ff6dfd5d5 100644 --- a/vertx-sql-client/src/main/java/io/vertx/sqlclient/impl/pool/SqlConnectionPool.java +++ b/vertx-sql-client/src/main/java/io/vertx/sqlclient/impl/pool/SqlConnectionPool.java @@ -32,6 +32,7 @@ import io.vertx.sqlclient.spi.DatabaseMetadata; import java.util.List; +import java.util.concurrent.TimeoutException; import java.util.function.Function; import java.util.function.Supplier; import java.util.stream.Collectors; @@ -217,12 +218,10 @@ public void onEnqueue(PoolWaiter waiter) { if (timeout > 0L && timerID == -1L) { timerID = context.setTimer(timeout, id -> { pool.cancel(waiter, ar -> { - if (ar.succeeded()) { - if (ar.result()) { - handler.handle(Future.failedFuture("Timeout")); - } + if (ar.succeeded() && ar.result()) { + handler.handle(Future.failedFuture(new TimeoutException("Timeout while waiting for connection"))); } else { - // ???? + handler.handle(Future.failedFuture(new TimeoutException("Failed to cancel pool request after timeout while waiting for connection"))); } }); });