https://kotlinlang.org logo
Title
r

Robert Menke

07/31/2019, 12:14 AM
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

e5l

07/31/2019, 6:16 AM
Hi @Robert Menke, Could you tell me why you receive
HttpResponse
instead of a data class?
c

cy

07/31/2019, 6:42 AM
@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.
1
👍 2
d

Dominaezzz

07/31/2019, 10:29 AM
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

e5l

07/31/2019, 11:29 AM
Thanks! I'll think how to support such API.
r

Robert Menke

07/31/2019, 1:29 PM
@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!