Added handler for cancellation exception in flush.
@@ -866,7 +866,7 @@ class NatsConnection implements Connection {
}
this.statistics.incrementFlushCounter();
- } catch (ExecutionException e) {
+ } catch (ExecutionException | CancellationException e) {
throw new TimeoutException(e.getMessage());
}
}
