File tree 2 files changed +2
-2
lines changed
common/kotlinx-coroutines-core-common
2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ import kotlin.jvm.*
25
25
* @param timeMillis timeout time in milliseconds.
26
26
*/
27
27
public 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" )
29
29
return suspendCoroutineUninterceptedOrReturn { uCont ->
30
30
setupTimeout(TimeoutCoroutine (timeMillis, uCont), block)
31
31
}
Original file line number Diff line number Diff line change @@ -175,7 +175,7 @@ class WithTimeoutTest : TestBase() {
175
175
expectUnreached()
176
176
" OK"
177
177
}
178
- } catch (e: CancellationException ) {
178
+ } catch (e: TimeoutCancellationException ) {
179
179
assertEquals(" Timed out immediately" , e.message)
180
180
finish(2 )
181
181
}
You can’t perform that action at this time.
0 commit comments