Код: Выделить всё
supervisorScope {
val deferred = async {
codeThatCanThrowExceptions()
}
try {
deferred.await()
} catch (e: Exception) {
// Handle exception
}
}
Подробнее здесь: https://stackoverflow.com/questions/796 ... but-a-fail
Код: Выделить всё
supervisorScope {
val deferred = async {
codeThatCanThrowExceptions()
}
try {
deferred.await()
} catch (e: Exception) {
// Handle exception
}
}