diff --git a/CHANGELOG.md b/CHANGELOG.md index ad911fb841..b718141c7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,17 @@ * `HttpClient#loadFile` * `PathedFile#download` +### 0.28.1 + +* Common: + * Versions updates: + * `Kotlin`: `1.4.0` -> `1.4.10` + * `UUID`: `0.2.1` -> `0.2.2` +* `TelegramBotAPI-core`: + * `ExceptionHandler` has changed its incoming type: `Exception` -> `Throwable` + * `handleSafely` has changed its signature + * `executeUnsafe` has changed its signature + ## 0.27.0 * `Common`: diff --git a/TelegramBotAPI-core/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/HandleSafely.kt b/TelegramBotAPI-core/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/HandleSafely.kt index 955cfe7bb7..b136954b55 100644 --- a/TelegramBotAPI-core/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/HandleSafely.kt +++ b/TelegramBotAPI-core/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/utils/HandleSafely.kt @@ -4,7 +4,7 @@ import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.supervisorScope -typealias ExceptionHandler = suspend (Exception) -> T +typealias ExceptionHandler = suspend (Throwable) -> T /** * It will run [block] inside of [supervisorScope] to avoid problems with catching of exceptions * @@ -17,7 +17,7 @@ suspend inline fun handleSafely( ): T { return try { supervisorScope(block) - } catch (e: Exception) { + } catch (e: Throwable) { onException(e) } } diff --git a/TelegramBotAPI-extensions-utils/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/utils/shortcuts/RequestsExecutor.kt b/TelegramBotAPI-extensions-utils/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/utils/shortcuts/RequestsExecutor.kt index 5157918216..61576dec2a 100644 --- a/TelegramBotAPI-extensions-utils/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/utils/shortcuts/RequestsExecutor.kt +++ b/TelegramBotAPI-extensions-utils/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/utils/shortcuts/RequestsExecutor.kt @@ -24,10 +24,10 @@ suspend fun RequestsExecutor.executeUnsafe( request: Request, retries: Int = 0, retriesDelay: Long = 1000L, - onAllFailed: (suspend (exceptions: Array) -> Unit)? = null + onAllFailed: (suspend (exceptions: Array) -> Unit)? = null ): T? { var leftRetries = retries - val exceptions = onAllFailed ?.let { mutableListOf() } + val exceptions = onAllFailed ?.let { mutableListOf() } do { return handleSafely( { diff --git a/gradle.properties b/gradle.properties index 82eb89a701..5f57bb8a1b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,16 +5,16 @@ kotlin.js.generate.externals=true kotlin.incremental=true kotlin.incremental.js=true -kotlin_version=1.4.0 +kotlin_version=1.4.10 kotlin_coroutines_version=1.3.9 kotlin_serialisation_runtime_version=1.0.0-RC klock_version=1.12.0 -uuid_version=0.2.1 +uuid_version=0.2.2 ktor_version=1.4.0 javax_activation_version=1.1.1 library_group=com.github.insanusmokrassar -library_version=0.28.0 +library_version=0.28.1 gradle_bintray_plugin_version=1.8.5 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index fa55e31a18..8d8e8abe86 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip