Hello, Is there a way to disable content-negotiati...
# ktor
p
Hello, Is there a way to disable content-negotiation before receiving a single call? The problem I'm trying to solve is that I want to write the content of the request to log if Gson throws a JsonParseException, but calling call.receiveText() from the exception handler will just result in a
RequestReceiveAlreadyFailedException: Request body consumption was failed
.
For those running into similar issues: I solved it by building a custom
ContentConverter
(see https://ktor.io/servers/features/content-negotiation.html) that wraps the
GsonConverter
and appends the faulty JSON to the exception message if thrown.
👍 3