Reject the future with an error.
(Object error)
| 37 | * Reject the future with an error. |
| 38 | */ |
| 39 | public void reject(Object error) { |
| 40 | Exception exception; |
| 41 | if (error instanceof Exception ex) { |
| 42 | exception = ex; |
| 43 | } else if (error == null) { |
| 44 | exception = new RuntimeException("Future rejected with null"); |
| 45 | } else { |
| 46 | exception = new RuntimeException("Future rejected: " + error); |
| 47 | } |
| 48 | this.completableFuture.completeExceptionally(exception); |
| 49 | } |
| 50 | |
| 51 | /** |
| 52 | * Get the underlying CompletableFuture for awaiting. |
no outgoing calls