Skip to content

Commit

Permalink
Unwrap DispatchException
Browse files Browse the repository at this point in the history
  • Loading branch information
zuevmaxim committed Sep 2, 2024
1 parent 1fbe6eb commit 7d0cbc4
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ internal fun <R, T> (suspend (R) -> T).startCoroutineUndispatched(receiver: R, c
startCoroutineUninterceptedOrReturn(receiver, actualCompletion)
}
} catch (e: Throwable) {
actualCompletion.resumeWithException(e)
val reportException = if (e is DispatchException) e.cause else e
actualCompletion.resumeWithException(reportException)
return
}
if (value !== COROUTINE_SUSPENDED) {
Expand Down

0 comments on commit 7d0cbc4

Please sign in to comment.