Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors handling in updates listening #55

Closed
Djaler opened this issue Jan 1, 2020 · 8 comments
Closed

Errors handling in updates listening #55

Djaler opened this issue Jan 1, 2020 · 8 comments

Comments

@Djaler
Copy link
Contributor

Djaler commented Jan 1, 2020

I got error #53 and, because this update can't be parsed, the whole updates listening stopped. Looks like there should be error handling. Both with webhooks and long polling

@InsanusMokrassar
Copy link
Owner

Hi, can you, please, send the error message or some logs?

@Djaler
Copy link
Contributor Author

Djaler commented Jan 2, 2020

Sure

2020-01-02T04:09:36.402117+00:00 app[web.1]: java.lang.IllegalArgumentException: Unknown type of message entity
2020-01-02T04:09:36.402120+00:00 app[web.1]: 	at com.github.insanusmokrassar.TelegramBotAPI.types.MessageEntity.RawMessageEntity.asMessageEntity(RawMessageEntity.kt:32)
2020-01-02T04:09:36.402132+00:00 app[web.1]: 	at com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage$content$2.invoke(RawMessage.kt:94)
2020-01-02T04:09:36.402134+00:00 app[web.1]: 	at com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage$content$2.invoke(RawMessage.kt:26)
2020-01-02T04:09:36.402136+00:00 app[web.1]: 	at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
2020-01-02T04:09:36.402137+00:00 app[web.1]: 	at com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage.getContent(RawMessage.kt)
2020-01-02T04:09:36.402139+00:00 app[web.1]: 	at com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage.access$getContent$p(RawMessage.kt:26)
2020-01-02T04:09:36.402140+00:00 app[web.1]: 	at com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage$asMessage$2.invoke(RawMessage.kt:211)
2020-01-02T04:09:36.402141+00:00 app[web.1]: 	at com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage$asMessage$2.invoke(RawMessage.kt:26)
2020-01-02T04:09:36.402143+00:00 app[web.1]: 	at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
2020-01-02T04:09:36.402144+00:00 app[web.1]: 	at com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage.getAsMessage(RawMessage.kt)
2020-01-02T04:09:36.402146+00:00 app[web.1]: 	at com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategy.deserialize(Message.kt:21)
2020-01-02T04:09:36.402155+00:00 app[web.1]: 	at com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializer.deserialize(Message.kt:30)
2020-01-02T04:09:36.402157+00:00 app[web.1]: 	at com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializer.deserialize(Message.kt:25)
2020-01-02T04:09:36.402158+00:00 app[web.1]: 	at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:34)
2020-01-02T04:09:36.402159+00:00 app[web.1]: 	at kotlinx.serialization.json.internal.StreamingJsonInput.decodeSerializableValue(StreamingJsonInput.kt:33)
2020-01-02T04:09:36.402161+00:00 app[web.1]: 	at kotlinx.serialization.Decoder$DefaultImpls.decodeNullableSerializableValue(Coders.kt:103)
2020-01-02T04:09:36.402162+00:00 app[web.1]: 	at kotlinx.serialization.json.JsonInput$DefaultImpls.decodeNullableSerializableValue(JsonInput.kt)
2020-01-02T04:09:36.402164+00:00 app[web.1]: 	at kotlinx.serialization.json.internal.StreamingJsonInput.decodeNullableSerializableValue(StreamingJsonInput.kt:16)
2020-01-02T04:09:36.402165+00:00 app[web.1]: 	at kotlinx.serialization.ElementValueDecoder.decodeNullableSerializableElement(ElementWise.kt:133)
2020-01-02T04:09:36.402166+00:00 app[web.1]: 	at com.github.insanusmokrassar.TelegramBotAPI.types.update.RawUpdate$$serializer.deserialize(RawUpdate.kt)
2020-01-02T04:09:36.402167+00:00 app[web.1]: 	at com.github.insanusmokrassar.TelegramBotAPI.types.update.RawUpdate$$serializer.deserialize(RawUpdate.kt:18)
2020-01-02T04:09:36.402168+00:00 app[web.1]: 	at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:34)
2020-01-02T04:09:36.402170+00:00 app[web.1]: 	at kotlinx.serialization.json.internal.StreamingJsonInput.decodeSerializableValue(StreamingJsonInput.kt:33)
2020-01-02T04:09:36.402171+00:00 app[web.1]: 	at kotlinx.serialization.CoreKt.decode(Core.kt:80)
2020-01-02T04:09:36.402172+00:00 app[web.1]: 	at kotlinx.serialization.json.Json.parse(Json.kt:126)
2020-01-02T04:09:36.402174+00:00 app[web.1]: 	at com.github.insanusmokrassar.TelegramBotAPI.utils.extensions.WebhooksKt$setWebhook$env$1$1$1$1.invokeSuspend(Webhooks.kt:77)
2020-01-02T04:09:36.402175+00:00 app[web.1]: 	at com.github.insanusmokrassar.TelegramBotAPI.utils.extensions.WebhooksKt$setWebhook$env$1$1$1$1.invoke(Webhooks.kt)
2020-01-02T04:09:36.402176+00:00 app[web.1]: 	at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:268)
2020-01-02T04:09:36.402178+00:00 app[web.1]: 	at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:141)
2020-01-02T04:09:36.402179+00:00 app[web.1]: 	at io.ktor.util.pipeline.SuspendFunctionGun.execute(PipelineContext.kt:161)
2020-01-02T04:09:36.402181+00:00 app[web.1]: 	at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:27)
2020-01-02T04:09:36.402182+00:00 app[web.1]: 	at io.ktor.routing.Routing.executeResult(Routing.kt:147)
2020-01-02T04:09:36.402184+00:00 app[web.1]: 	at io.ktor.routing.Routing.interceptor(Routing.kt:34)
2020-01-02T04:09:36.402185+00:00 app[web.1]: 	at io.ktor.routing.Routing$Feature$install$1.invokeSuspend(Routing.kt:99)
2020-01-02T04:09:36.402186+00:00 app[web.1]: 	at io.ktor.routing.Routing$Feature$install$1.invoke(Routing.kt)
2020-01-02T04:09:36.402187+00:00 app[web.1]: 	at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:268)
2020-01-02T04:09:36.402189+00:00 app[web.1]: 	at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:141)
2020-01-02T04:09:36.402190+00:00 app[web.1]: 	at io.ktor.util.pipeline.SuspendFunctionGun.execute(PipelineContext.kt:161)
2020-01-02T04:09:36.402191+00:00 app[web.1]: 	at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:27)
2020-01-02T04:09:36.402193+00:00 app[web.1]: 	at io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$2.invokeSuspend(DefaultEnginePipeline.kt:118)
2020-01-02T04:09:36.402202+00:00 app[web.1]: 	at io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$2.invoke(DefaultEnginePipeline.kt)
2020-01-02T04:09:36.402204+00:00 app[web.1]: 	at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:268)
2020-01-02T04:09:36.402205+00:00 app[web.1]: 	at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:141)
2020-01-02T04:09:36.402206+00:00 app[web.1]: 	at io.ktor.util.pipeline.SuspendFunctionGun.execute(PipelineContext.kt:161)
2020-01-02T04:09:36.402207+00:00 app[web.1]: 	at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:27)
2020-01-02T04:09:36.402209+00:00 app[web.1]: 	at io.ktor.server.netty.NettyApplicationCallHandler$handleRequest$1.invokeSuspend(NettyApplicationCallHandler.kt:40)
2020-01-02T04:09:36.402210+00:00 app[web.1]: 	at io.ktor.server.netty.NettyApplicationCallHandler$handleRequest$1.invoke(NettyApplicationCallHandler.kt)
2020-01-02T04:09:36.402211+00:00 app[web.1]: 	at kotlinx.coroutines.intrinsics.UndispatchedKt.startCoroutineUndispatched(Undispatched.kt:55)
2020-01-02T04:09:36.402213+00:00 app[web.1]: 	at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:111)
2020-01-02T04:09:36.402214+00:00 app[web.1]: 	at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:154)
2020-01-02T04:09:36.402215+00:00 app[web.1]: 	at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:54)
2020-01-02T04:09:36.402217+00:00 app[web.1]: 	at kotlinx.coroutines.BuildersKt.launch(Unknown Source)
2020-01-02T04:09:36.402218+00:00 app[web.1]: 	at io.ktor.server.netty.NettyApplicationCallHandler.handleRequest(NettyApplicationCallHandler.kt:30)
2020-01-02T04:09:36.402219+00:00 app[web.1]: 	at io.ktor.server.netty.NettyApplicationCallHandler.channelRead(NettyApplicationCallHandler.kt:24)
2020-01-02T04:09:36.402220+00:00 app[web.1]: 	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
2020-01-02T04:09:36.402221+00:00 app[web.1]: 	at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:56)
2020-01-02T04:09:36.402223+00:00 app[web.1]: 	at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:365)
2020-01-02T04:09:36.402224+00:00 app[web.1]: 	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
2020-01-02T04:09:36.402225+00:00 app[web.1]: 	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:510)
2020-01-02T04:09:36.402227+00:00 app[web.1]: 	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:518)
2020-01-02T04:09:36.402228+00:00 app[web.1]: 	at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1050)
2020-01-02T04:09:36.402229+00:00 app[web.1]: 	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
2020-01-02T04:09:36.402231+00:00 app[web.1]: 	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
2020-01-02T04:09:36.402234+00:00 app[web.1]: 	at java.lang.Thread.run(Thread.java:748)

@InsanusMokrassar
Copy link
Owner

I see, thanks

@InsanusMokrassar
Copy link
Owner

@Djaler I have fixed the issue in e749546 . You can try to build this version for yourself. I will publish new version when complete work with updating of library

@Djaler
Copy link
Contributor Author

Djaler commented Jan 2, 2020

What about errors handling in parsing? Because when one update cannot be parsed, the rest updates cannot be processed too, even if they doesn't contain nothing special. The library need this to work good with future API updates

@InsanusMokrassar
Copy link
Owner

Fix of this will be included into new version:) it is the reason why I offer you to build it by yourself or to wait new version. Other option is to make get request for updates from some rest client

@Djaler
Copy link
Contributor Author

Djaler commented Jan 2, 2020

I understood. Will wait, thanks

@InsanusMokrassar
Copy link
Owner

I understood. Will wait, thanks

I hope, I will release new version in a few days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants