return previous logic of work with safely

This commit is contained in:
InsanusMokrassar 2021-05-26 17:59:40 +06:00
parent 041be5a1d1
commit 242f4b02d0
3 changed files with 2 additions and 3 deletions

View File

@ -3,7 +3,6 @@
## 0.5.3
* `Coroutines`:
* **Mechanism of `safely` has been changed: instead of creating new scope now is used `withContext`**
* Extensions `doInUI` and `doInDefault` were replaced in common and available on any supported platform
* Extension `doInIO` replaced into `jvm` and available on any `JVM` platform
* Old extension `safelyWithouException` without `onException` has been replaced by its copy with `onException` and

View File

@ -19,4 +19,4 @@ kotlin {
}
}
}
}
}

View File

@ -101,7 +101,7 @@ suspend inline fun <T> safely(
noinline block: suspend CoroutineScope.() -> T
): T {
return try {
withContext(SupervisorJob(), block)
supervisorScope(block)
} catch (e: Throwable) {
coroutineContext[ContextSafelyExceptionHandlerKey] ?.handler ?.invoke(e)
onException(e)