Ha omitting `response.close()` caused one of our s...
# ktor
r
Ha omitting
response.close()
caused one of our servers to run out of memory today @Dominaezzz. Just fixed it and fortunately had no downtime because ECS is pretty nice 🙂.
🤔 1
e
Hi @Robert Menke, Could you tell me why you receive
HttpResponse
instead of a data class?
c
@e5l this makes impression that receiving response/call/ws-session is too dangerous. We probably need to deprecate and prohibit it and provide
client....useResponse { ... }
instead.
👍 2
1
d
Ha, I luckily haven't deployed anything yet.
@e5l I receive
HttpResponse
because the server returns different Json object for success and error case. So if the code is 200, I call
return response.receive<User>()
else I call
throw response.receive<CustomError>()
.
e
Thanks! I'll think how to support such API.
r
@e5l We were interested in the status code returned by the server we were reaching out to in this case in addition to the data. Thanks for following up!