Skip to content

Commit 0ea765f

Browse files
authored
Refactor Flow.catchImpl to use currentCoroutineContext (#4519)
1 parent 6c2e65b commit 0ea765f

File tree

1 file changed

+1
-1
lines changed
  • kotlinx-coroutines-core/common/src/flow/operators

1 file changed

+1
-1
lines changed

kotlinx-coroutines-core/common/src/flow/operators/Errors.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ internal suspend fun <T> Flow<T>.catchImpl(
164164
* First check ensures that we catch an original exception, not one rethrown by an operator.
165165
* Seconds check ignores cancellation causes, they cannot be caught.
166166
*/
167-
if (e.isSameExceptionAs(fromDownstream) || e.isCancellationCause(coroutineContext)) {
167+
if (e.isSameExceptionAs(fromDownstream) || e.isCancellationCause(currentCoroutineContext())) {
168168
throw e // Rethrow exceptions from downstream and cancellation causes
169169
} else {
170170
/*

0 commit comments

Comments
 (0)