File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
integration/kotlinx-coroutines-jdk8/src/future Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -95,15 +95,15 @@ public fun <T> CompletionStage<T>.asDeferred(): Deferred<T> {
9595 } catch (e: Throwable ) {
9696 // unwrap original cause from ExecutionException
9797 val original = (e as ? ExecutionException )?.cause ? : e
98- CompletableDeferred <T >().also { it.cancel (original) }
98+ CompletableDeferred <T >().also { it.completeExceptionally (original) }
9999 }
100100 }
101101 val result = CompletableDeferred <T >()
102102 whenComplete { value, exception ->
103103 if (exception == null ) {
104104 result.complete(value)
105105 } else {
106- result.cancel (exception)
106+ result.completeExceptionally (exception)
107107 }
108108 }
109109 if (this is Future <* >) result.cancelFutureOnCompletion(this )
You can’t perform that action at this time.
0 commit comments