File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
common/kotlinx-coroutines-core-common Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ import kotlin.jvm.*
2525 * @param timeMillis timeout time in milliseconds.
2626 */
2727public suspend fun <T > withTimeout (timeMillis : Long , block : suspend CoroutineScope .() -> T ): T {
28- if (timeMillis <= 0L ) throw CancellationException (" Timed out immediately" )
28+ if (timeMillis <= 0L ) throw TimeoutCancellationException (" Timed out immediately" )
2929 return suspendCoroutineUninterceptedOrReturn { uCont ->
3030 setupTimeout(TimeoutCoroutine (timeMillis, uCont), block)
3131 }
Original file line number Diff line number Diff line change @@ -175,7 +175,7 @@ class WithTimeoutTest : TestBase() {
175175 expectUnreached()
176176 " OK"
177177 }
178- } catch (e: CancellationException ) {
178+ } catch (e: TimeoutCancellationException ) {
179179 assertEquals(" Timed out immediately" , e.message)
180180 finish(2 )
181181 }
You can’t perform that action at this time.
0 commit comments