Getting this weird error trying to deserialize fairly long json response
Copy code
Exception in thread "main" io.ktor.utils.io.charsets.TooLongLineException: Line is longer than limit
at io.ktor.utils.io.ByteBufferChannel$readUTF8LineToUtf8Suspend$2.invoke(ByteBufferChannel.kt:2022)
at io.ktor.utils.io.ByteBufferChannel$readUTF8LineToUtf8Suspend$2.invoke(ByteBufferChannel.kt:1960)
at io.ktor.utils.io.ByteBufferChannel.read$suspendImpl(ByteBufferChannel.kt:1648)
at io.ktor.utils.io.ByteBufferChannel.read(ByteBufferChannel.kt)
at io.ktor.utils.io.ByteBufferChannel.readUTF8LineToUtf8Suspend(ByteBufferChannel.kt:1960)
at io.ktor.utils.io.ByteBufferChannel.access$readUTF8LineToUtf8Suspend(ByteBufferChannel.kt:23)
at io.ktor.utils.io.ByteBufferChannel$readUTF8LineToUtf8Suspend$1.invokeSuspend(ByteBufferChannel.kt)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
Any clues what might be wrong (no kdocs on the exception)?
Big Chungus
04/28/2024, 12:52 PM
In case anyone else faces this in the future, the exception basically means your request url was too long (i had way too many parameters).
s
Stylianos Gakis
04/28/2024, 2:50 PM
What defines "too long" here? 😅
b
Big Chungus
04/28/2024, 3:05 PM
Didn't capture that sadly, but that exception is only thrown once in the client codebase so you should be able to find the condition for it fairly easily.
Big Chungus
04/28/2024, 5:00 PM
Looks like it's Int.MAX_VALUE (2147483647) "most" of the time.
s
Stylianos Gakis
04/28/2024, 5:25 PM
I am now scared, what was in that url
😆 1
b
Big Chungus
04/28/2024, 5:39 PM
Lots of ids returned in the previous request apparently, wasn't expecting to get the entire history of ids since the dawn of time returned in a single json object property...