diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ed40c40cf..ae7534f3de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,8 @@ * 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` ## 0.27.0 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) } }