mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2025-10-20 14:50:17 +00:00
return previous logic of work with safely
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user