You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the current version of the library, withTimeout throws TimeoutCancellationException when a timeout was exceeded.
It can lead to very subtle errors, for example:
launch {
val result = withTimeout(...) {
// ... some computation ...
}
// process result
}
TimeoutCancellationException is CancellationException, thus is never reported.
But in the snippet above, it's likely to be a programmatic error. If it is expected to miss the deadline, then withTimeoutOrNull should be used explicitly.
My proposal is deprecation of TimeoutCancellationException and replacement with TimeoutException that is not CancellationException
hrach, zach-klippenstein, maxmodestov, artbez, Dougrinch and 31 more