File tree 1 file changed +3
-3
lines changed
reactive/kotlinx-coroutines-reactive/test
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -216,17 +216,17 @@ class IntegrationTest(
216
216
private suspend inline fun <reified E : Throwable > assertCallsExceptionHandlerWith (
217
217
crossinline operation : suspend () -> Unit ): E
218
218
{
219
- var caughtException : Throwable ? = null
219
+ val caughtExceptions = mutableListOf< Throwable >()
220
220
val exceptionHandler = object : AbstractCoroutineContextElement (CoroutineExceptionHandler ),
221
221
CoroutineExceptionHandler
222
222
{
223
223
override fun handleException (context : CoroutineContext , exception : Throwable ) {
224
- caughtException = exception
224
+ caughtExceptions + = exception
225
225
}
226
226
}
227
227
return withContext(exceptionHandler) {
228
228
operation()
229
- caughtException .let {
229
+ caughtExceptions.single() .let {
230
230
assertTrue(it is E )
231
231
it
232
232
}
You can’t perform that action at this time.
0 commit comments