Skip to content

Commit 8a494e9

Browse files
committed
Report dispatcher and context
1 parent 6a57d8f commit 8a494e9

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

kotlinx-coroutines-core/common/src/internal/DispatchedContinuation.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ internal class DispatchedContinuation<in T>(
265265
try {
266266
dispatcher.dispatch(context, this)
267267
} catch (e: Throwable) {
268-
throw DispatchException(e)
268+
throw DispatchException(e, dispatcher, context)
269269
}
270270
}
271271
}

kotlinx-coroutines-core/common/src/internal/DispatchedTask.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -225,4 +225,8 @@ internal inline fun Continuation<*>.resumeWithStackTrace(exception: Throwable) {
225225
*
226226
* @see DispatchedContinuation.dispatchWithExceptionHandling
227227
*/
228-
internal class DispatchException(cause: Throwable) : Exception(cause)
228+
internal class DispatchException(
229+
override val cause: Throwable,
230+
dispatcher: CoroutineDispatcher,
231+
context: CoroutineContext,
232+
) : Exception("Coroutine dispatcher $dispatcher threw an exception, context = $context", cause)

0 commit comments

Comments
 (0)