Nikky
06/22/2019, 8:50 PMval (request, response, result) = url.httpGet()
.awaitObjectResponseResult(kotlinxDeserializerOf(loader = Type.serializer(), json = json))
return when (result) {
is Result.Success -> result.value
is Result.Failure -> {
logger.error("failed request")
logger.error("url: $url")
logger.error("cUrl: ${request.cUrlString()}")
logger.error("response: $response")
logger.error(result.error.exception) { result.error }
throw result.error.exception
}
}
rethrowing might not be the wisest choice but thats not really what matters
i guess i could make this same thing happen wit ha inline function and lamdda to configure the request or so.. to avoid copypasting the same stuff all over the place