Hey guys, one thing I’ve noticed since switched to...
# ktor
a
Hey guys, one thing I’ve noticed since switched to ktor 1.4 (not sure if it was there before as well): when there is a (de)serialization problem during
call.recieve
or
call.respond
- it actually hides the exception and only prints something like this:
INFO Application - 200 OK: GET - /api/v2/announcements, io failed
In the case of deserialization exception during
call.recieve
it returns empty reponse with status 500, in the case of serialization durint
call.respond
it returns empty response with status 200 (and this is even more of a problem). Does it mean that the best practice is to always wrap both method calls with try..catch? Or any configuration option I can enable to make such issues more prominent in the logs and the ways responses are handled?
r
do you mind creating an issue with a minimal reproduce example?
a
Absolutely, will do so as long as you consider this to be an issue.
r
Returning 200 is definitely an issue. It is possible related to https://youtrack.jetbrains.com/issue/KTOR-835 And there is PR to fix it https://github.com/ktorio/ktor/pull/2088. But it can’t be landed before 1.5 release since it has api change.
a
Got it, will look into the existing issue and create a new one if needed.
r
returning 500 on unhandled exception in request is an expected behaviour
if you will create an issue, please specify engine and serialiser that you use
a
yep, for the reference it is netty and jackson