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

Method cancelThrow

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

Cancels a call, and throws the exception. @param t must be a RuntimeException or Error

(ClientCall<?, ?> call, Throwable t)

Source from the content-addressed store, hash-verified

379 * @param t must be a RuntimeException or Error
380 */
381 private static RuntimeException cancelThrow(ClientCall<?, ?> call, Throwable t) {
382 try {
383 call.cancel(null, t);
384 } catch (RuntimeException | Error e) {
385 logger.log(Level.SEVERE, "RuntimeException encountered while closing call", e);
386 }
387 if (t instanceof RuntimeException) {
388 throw (RuntimeException) t;
389 } else if (t instanceof Error) {
390 throw (Error) t;
391 }
392 // should be impossible
393 throw new AssertionError(t);
394 }
395
396 private static <ReqT, RespT> void asyncUnaryRequestCall(
397 ClientCall<ReqT, RespT> call, ReqT req, StreamObserver<RespT> responseObserver,

Callers 2

blockingUnaryCallMethod · 0.95
asyncUnaryRequestCallMethod · 0.95

Calls 2

cancelMethod · 0.65
logMethod · 0.45

Tested by

no test coverage detected