RI
Size: a a a
RI
VS
RI
VS
Ⓢ
RI
VS
VS
RI
import kotlinx.coroutines.*
suspend fun test() {
println("test.begin")
try {
delay(5000)
} catch (e: TimeoutCancellationException) {
// It is important to throw an exception different from CancellationException
throw RuntimeException("delay was cancelled", e) // <-- line 9
}
println("test.end")
}
suspend fun proxy() {
test()
}
fun main() {
runBlocking { // <-- line 15
withTimeout(100) {
proxy()
}
}
}
VS
import kotlinx.coroutines.*
suspend fun test() {
println("test.begin")
try {
delay(5000)
} catch (e: Throwable) {
// It is important to throw an exception different from CancellationException
throw RuntimeException("in test", e)
}
println("test.end")
}
suspend fun proxy() {
try {
test()
} catch (e: Throwable) {
// It is important to throw an exception different from CancellationException
throw RuntimeException("in proxy", e)
}
}
fun main() {
runBlocking {
withTimeout(100) {
proxy()
}
}
}
RI
VS
VS
VS
RI
RI
VS
import kotlinx.coroutines.*
suspend fun test() {
println("test.begin")
try {
delay(5000)
} catch (e: Throwable) {
throw RuntimeException("in test").also { it.printStackTrace() }
}
println("test.end")
}
suspend fun proxy() {
try {
test()
} catch (e: Throwable) {
throw RuntimeException("in proxy").also { it.printStackTrace() }
}
}
fun main() {
runBlocking {
withTimeout(100) {
proxy()
}
}
}
VS
RI
RI