return previous logic of work with safely

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

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)