MCPcopy Create free account
hub / github.com/grpc/grpc-java / getUnchecked

Method getUnchecked

stub/src/main/java/io/grpc/stub/ClientCalls.java:339–351  ·  view source on GitHub ↗

Returns the result of calling Future#get() interruptibly on a task known not to throw a checked exception. If interrupted, the interrupt is restored before throwing an exception.. @throws java.util.concurrent.CancellationException if get throws a {@code CancellationException

(Future<V> future)

Source from the content-addressed store, hash-verified

337 * or an {@link InterruptedException}.
338 */
339 private static <V> V getUnchecked(Future<V> future) {
340 try {
341 return future.get();
342 } catch (InterruptedException e) {
343 Thread.currentThread().interrupt();
344 throw Status.CANCELLED
345 .withDescription("Thread interrupted")
346 .withCause(e)
347 .asRuntimeException();
348 } catch (ExecutionException e) {
349 throw toStatusRuntimeException(e.getCause());
350 }
351 }
352
353 /**
354 * Wraps the given {@link Throwable} in a {@link StatusRuntimeException}. If it contains an

Callers 2

blockingUnaryCallMethod · 0.95

Calls 6

asRuntimeExceptionMethod · 0.80
withCauseMethod · 0.80
withDescriptionMethod · 0.80
getCauseMethod · 0.80
getMethod · 0.65

Tested by 1