From c9bbfa38206e78bdafbc5e6e4a841a93348e4f1c Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sat, 4 Sep 2021 14:58:15 +0600 Subject: [PATCH] update gradle config and fix build --- .../dev/inmo/micro_utils/coroutines/HandleSafely.kt | 8 +++----- gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/HandleSafely.kt b/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/HandleSafely.kt index 92f43522de7..bc662e79086 100644 --- a/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/HandleSafely.kt +++ b/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/HandleSafely.kt @@ -39,11 +39,9 @@ object ContextSafelyExceptionHandlerKey : CoroutineContext.Key -) : 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 runCatchingSafelyWithoutExceptions( safelyWithoutExceptions(onException, block) } -suspend inline fun CoroutineScope( +inline fun CoroutineScope( context: CoroutineContext, - defaultExceptionsHandler: ExceptionHandler + noinline defaultExceptionsHandler: ExceptionHandler ) = CoroutineScope( context + ContextSafelyExceptionHandler(defaultExceptionsHandler) ) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 05679dc3c18..ffed3a254e9 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists