diff --git a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/updates/UpdatesPolling.kt b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/updates/UpdatesPolling.kt index d39bd17fa4..9f18c87bc1 100644 --- a/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/updates/UpdatesPolling.kt +++ b/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/updates/UpdatesPolling.kt @@ -27,13 +27,9 @@ fun RequestsExecutor.startGettingOfUpdates( while (isActive) { handleSafely( { e -> - when (e) { - is HttpRequestTimeoutException -> exceptionsHandler ?.invoke(e) - is RequestException -> { - exceptionsHandler ?.invoke(e) - delay(1000L) - } - else -> exceptionsHandler ?.invoke(e) + exceptionsHandler ?.invoke(e) + if (e is RequestException) { + delay(1000L) } } ) {