mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2025-09-03 15:19:44 +00:00
update gradle config and fix build
This commit is contained in:
@@ -39,11 +39,9 @@ object ContextSafelyExceptionHandlerKey : CoroutineContext.Key<ContextSafelyExce
|
||||
*/
|
||||
class ContextSafelyExceptionHandler(
|
||||
val handler: ExceptionHandler<Unit>
|
||||
) : CoroutineContext.Element, CoroutineExceptionHandler {
|
||||
) : CoroutineContext.Element {
|
||||
override val key: CoroutineContext.Key<*>
|
||||
get() = ContextSafelyExceptionHandlerKey
|
||||
|
||||
override fun handleException(context: CoroutineContext, exception: Throwable) = handler(exception)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -150,9 +148,9 @@ suspend inline fun <T> runCatchingSafelyWithoutExceptions(
|
||||
safelyWithoutExceptions(onException, block)
|
||||
}
|
||||
|
||||
suspend inline fun CoroutineScope(
|
||||
inline fun CoroutineScope(
|
||||
context: CoroutineContext,
|
||||
defaultExceptionsHandler: ExceptionHandler<Unit>
|
||||
noinline defaultExceptionsHandler: ExceptionHandler<Unit>
|
||||
) = CoroutineScope(
|
||||
context + ContextSafelyExceptionHandler(defaultExceptionsHandler)
|
||||
)
|
||||
|
Reference in New Issue
Block a user