We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 83ffd17 commit b545807Copy full SHA for b545807
kotlinx-coroutines-core/jvm/test/exceptions/StackTraceRecoveryCustomExceptionsTest.kt
@@ -124,4 +124,22 @@ class StackTraceRecoveryCustomExceptionsTest : TestBase() {
124
assertTrue(ex is CopyableWithCustomMessage)
125
assertEquals("Recovered: [OK]", ex.message)
126
}
127
+
128
+ @Test
129
+ fun testTryCopyThrows() = runTest {
130
+ class FailingException : Exception(), CopyableThrowable<FailingException> {
131
+ override fun createCopy(): FailingException? {
132
+ TODO("Not yet implemented")
133
+ }
134
135
136
+ val e = FailingException()
137
+ val result = runCatching {
138
+ coroutineScope<Unit> {
139
+ throw e
140
141
142
143
+ assertSame(e, result.exceptionOrNull())
144
145
0 commit comments