Cancels a call, and throws the exception. @param t must be a RuntimeException or Error
(ClientCall<?, ?> call, Throwable t)
| 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, |
no test coverage detected