mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-12-22 16:47:15 +00:00
return previous logic of work with safely
This commit is contained in:
parent
041be5a1d1
commit
242f4b02d0
@ -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
|
||||
|
@ -19,4 +19,4 @@ kotlin {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user