mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2026-03-07 11:22:34 +00:00
@@ -1,5 +1,6 @@
|
||||
package dev.inmo.tgbotapi.extensions.utils.updates.retrieving
|
||||
|
||||
import dev.inmo.kslog.common.e
|
||||
import dev.inmo.micro_utils.coroutines.*
|
||||
import dev.inmo.tgbotapi.bot.RequestsExecutor
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
@@ -122,7 +123,7 @@ fun TelegramBot.longPollingFlow(
|
||||
|
||||
withContext(contextToWork) {
|
||||
while (isActive) {
|
||||
runCatchingLogging(logger = Log) {
|
||||
runCatching {
|
||||
execute(
|
||||
getUpdatesRequestCreator(lastUpdateIdentifier ?.plus(1))
|
||||
).let { originalUpdates ->
|
||||
@@ -136,6 +137,8 @@ fun TelegramBot.longPollingFlow(
|
||||
return@onFailure
|
||||
}
|
||||
|
||||
Log.e(e) { "Error during getting and handling of updates happen" }
|
||||
|
||||
exceptionsHandler?.invoke(e)
|
||||
|
||||
// It seems some problems with internet connection. See https://github.com/InsanusMokrassar/ktgbotapi/issues/989
|
||||
|
||||
Reference in New Issue
Block a user