private <T> T complete(CompletableFuture<T> future) { try { return future.get(operationTimeoutMillis, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new PrimitiveException.Interrupted(); } catch (TimeoutException e) { throw new PrimitiveException.Timeout(); } catch (ExecutionException e) { throw new PrimitiveException(e.getCause()); } } }
private <T> T complete(CompletableFuture<T> future) { try { return future.get(operationTimeoutMillis, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new PrimitiveException.Interrupted(); } catch (TimeoutException e) { throw new PrimitiveException.Timeout(); } catch (ExecutionException e) { throw new PrimitiveException(e.getCause()); } } }
private <T> T complete(CompletableFuture<T> future) { try { return future.get(operationTimeoutMillis, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new PrimitiveException.Interrupted(); } catch (TimeoutException e) { throw new PrimitiveException.Timeout(); } catch (ExecutionException e) { Throwables.propagateIfPossible(e.getCause()); throw new PrimitiveException(e.getCause()); } } }
private <T> T complete(CompletableFuture<T> future) { try { return future.get(operationTimeoutMillis, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new PrimitiveException.Interrupted(); } catch (TimeoutException e) { throw new PrimitiveException.Timeout(); } catch (ExecutionException e) { Throwables.propagateIfPossible(e.getCause()); throw new PrimitiveException(e.getCause()); } } }
private <T> T complete(CompletableFuture<T> future) { try { return future.get(operationTimeoutMillis, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new PrimitiveException.Interrupted(); } catch (TimeoutException e) { throw new PrimitiveException.Timeout(); } catch (ExecutionException e) { throw new PrimitiveException(e.getCause()); } } }
private <T> T complete(CompletableFuture<T> future) { try { return future.get(operationTimeoutMillis, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new PrimitiveException.Interrupted(); } catch (TimeoutException e) { throw new PrimitiveException.Timeout(); } catch (ExecutionException e) { if (e.getCause() instanceof PrimitiveException) { throw (PrimitiveException) e.getCause(); } else { throw new PrimitiveException(e.getCause()); } } } }
private <T> T complete(CompletableFuture<T> future) { try { return future.get(operationTimeoutMillis, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new PrimitiveException.Interrupted(); } catch (TimeoutException e) { throw new PrimitiveException.Timeout(); } catch (ExecutionException e) { if (e.getCause() instanceof PrimitiveException) { throw (PrimitiveException) e.getCause(); } else { throw new PrimitiveException(e.getCause()); } } } }
private <T> T complete(CompletableFuture<T> future) { try { return future.get(operationTimeoutMillis, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new PrimitiveException.Interrupted(); } catch (TimeoutException e) { throw new PrimitiveException.Timeout(); } catch (ExecutionException e) { if (e.getCause() instanceof PrimitiveException) { throw (PrimitiveException) e.getCause(); } else { throw new PrimitiveException(e.getCause()); } } } }
protected <T> T complete(CompletableFuture<T> future) { try { return future.get(operationTimeoutMillis, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new PrimitiveException.Interrupted(); } catch (TimeoutException e) { throw new PrimitiveException.Timeout(); } catch (ExecutionException e) { if (e.getCause() instanceof PrimitiveException) { throw (PrimitiveException) e.getCause(); } else if (e.getCause() instanceof NoSuchElementException) { throw (NoSuchElementException) e.getCause(); } else { throw new PrimitiveException(e.getCause()); } } } }
private <T> T complete(CompletableFuture<T> future) { try { return future.get(operationTimeoutMillis, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new PrimitiveException.Interrupted(); } catch (TimeoutException e) { throw new PrimitiveException.Timeout(); } catch (ExecutionException e) { Throwable cause = Throwables.getRootCause(e); if (cause instanceof PrimitiveException) { throw (PrimitiveException) cause; } else { throw new PrimitiveException(cause); } } } }
private <T> T complete(CompletableFuture<T> future) { try { return future.get(operationTimeoutMillis, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new PrimitiveException.Interrupted(); } catch (TimeoutException e) { throw new PrimitiveException.Timeout(); } catch (ExecutionException e) { Throwable cause = Throwables.getRootCause(e); if (cause instanceof PrimitiveException) { throw (PrimitiveException) cause; } else { throw new PrimitiveException(cause); } } } }
private <T> T complete(CompletableFuture<T> future) { try { return future.get(operationTimeoutMillis, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new PrimitiveException.Interrupted(); } catch (TimeoutException e) { throw new PrimitiveException.Timeout(); } catch (ExecutionException e) { Throwable cause = Throwables.getRootCause(e); if (cause instanceof PrimitiveException) { throw (PrimitiveException) cause; } else { throw new PrimitiveException(cause); } } } }
private <T> T complete(CompletableFuture<T> future) { try { return future.get(operationTimeoutMillis, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new PrimitiveException.Interrupted(); } catch (TimeoutException e) { throw new PrimitiveException.Timeout(); } catch (ExecutionException e) { Throwable cause = Throwables.getRootCause(e); if (cause instanceof PrimitiveException) { throw (PrimitiveException) cause; } else { throw new PrimitiveException(cause); } } } }
private <T> T complete(CompletableFuture<T> future) { try { return future.get(operationTimeoutMillis, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new PrimitiveException.Interrupted(); } catch (TimeoutException e) { throw new PrimitiveException.Timeout(); } catch (ExecutionException e) { Throwable cause = Throwables.getRootCause(e); if (cause instanceof PrimitiveException) { throw (PrimitiveException) cause; } else { throw new PrimitiveException(cause); } } } }
private <T> T complete(CompletableFuture<T> future) { try { return future.get(operationTimeoutMillis, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new PrimitiveException.Interrupted(); } catch (TimeoutException e) { throw new PrimitiveException.Timeout(); } catch (ExecutionException e) { Throwable cause = Throwables.getRootCause(e); if (cause instanceof PrimitiveException) { throw (PrimitiveException) cause; } else { throw new PrimitiveException(cause); } } } }
private <T> T complete(CompletableFuture<T> future) { try { return future.get(operationTimeoutMillis, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new PrimitiveException.Interrupted(); } catch (TimeoutException e) { throw new PrimitiveException.Timeout(); } catch (ExecutionException e) { Throwable cause = Throwables.getRootCause(e); if (cause instanceof PrimitiveException) { throw (PrimitiveException) cause; } else { throw new PrimitiveException(cause); } } } }
private <T> T complete(CompletableFuture<T> future) { try { return future.get(operationTimeoutMillis, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new PrimitiveException.Interrupted(); } catch (TimeoutException e) { throw new PrimitiveException.Timeout(); } catch (ExecutionException e) { Throwable cause = Throwables.getRootCause(e); if (cause instanceof PrimitiveException) { throw (PrimitiveException) cause; } else { throw new PrimitiveException(cause); } } } }
protected <T> T complete(CompletableFuture<T> future) { try { return future.get(operationTimeoutMillis, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new PrimitiveException.Interrupted(); } catch (TimeoutException e) { throw new PrimitiveException.Timeout(); } catch (ExecutionException e) { Throwable cause = Throwables.getRootCause(e); if (cause instanceof PrimitiveException) { throw (PrimitiveException) cause; } else { throw new PrimitiveException(cause); } } } }
private <T> T complete(CompletableFuture<T> future) { try { return future.get(operationTimeoutMillis, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new PrimitiveException.Interrupted(); } catch (TimeoutException e) { throw new PrimitiveException.Timeout(); } catch (ExecutionException e) { Throwable cause = Throwables.getRootCause(e); if (cause instanceof PrimitiveException) { throw (PrimitiveException) cause; } else { throw new PrimitiveException(cause); } } } }
private <T> T complete(CompletableFuture<T> future) { try { return future.get(operationTimeoutMillis, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new PrimitiveException.Interrupted(); } catch (TimeoutException e) { throw new PrimitiveException.Timeout(); } catch (ExecutionException e) { Throwable cause = Throwables.getRootCause(e); if (cause instanceof PrimitiveException) { throw (PrimitiveException) cause; } else { throw new PrimitiveException(cause); } } } }