diff --git a/java/flight/flight-jdbc-driver/src/main/java/org/apache/arrow/driver/jdbc/utils/FlightStreamQueue.java b/java/flight/flight-jdbc-driver/src/main/java/org/apache/arrow/driver/jdbc/utils/FlightStreamQueue.java index 6cd9ceaa227..e1d770800e4 100644 --- a/java/flight/flight-jdbc-driver/src/main/java/org/apache/arrow/driver/jdbc/utils/FlightStreamQueue.java +++ b/java/flight/flight-jdbc-driver/src/main/java/org/apache/arrow/driver/jdbc/utils/FlightStreamQueue.java @@ -93,7 +93,7 @@ public boolean isClosed() { */ @FunctionalInterface interface FlightStreamSupplier { - Future get() throws SQLTimeoutException; + Future get() throws SQLException; } private FlightStream next(final FlightStreamSupplier flightStreamSupplier) throws SQLException { @@ -107,7 +107,7 @@ private FlightStream next(final FlightStreamSupplier flightStreamSupplier) throw return stream; } } catch (final ExecutionException | InterruptedException | CancellationException e) { - throw AvaticaConnection.HELPER.wrap("Query canceled", e); + throw AvaticaConnection.HELPER.wrap(e.getMessage(), e); } } return null; @@ -147,7 +147,7 @@ public FlightStream next() throws SQLException { try { return completionService.take(); } catch (final InterruptedException e) { - throw AvaticaConnection.HELPER.wrap("Query canceled", e); + throw AvaticaConnection.HELPER.wrap(e.getMessage(), e); } }); }