kittinunf
06/03/2019, 6:07 AMkittinunf
06/03/2019, 6:07 AMkittinunf
06/03/2019, 6:07 AMitnoles
06/03/2019, 6:31 AMitnoles
06/03/2019, 2:39 PMDerk-Jan Karrenbeld
06/03/2019, 5:57 PMitnoles
06/03/2019, 6:53 PMitnoles
06/03/2019, 8:17 PMNikky
06/03/2019, 9:23 PMNikky
06/03/2019, 9:24 PMkittinunf
06/04/2019, 3:28 AMNikky
06/04/2019, 7:49 AMitnoles
06/04/2019, 9:48 PMitnoles
06/05/2019, 3:53 AMitnoles
06/07/2019, 5:34 AMkittinunf
06/07/2019, 8:30 AMNikky
06/20/2019, 7:22 PMitnoles
06/21/2019, 2:10 AMitnoles
06/21/2019, 2:11 AMitnoles
06/21/2019, 3:57 PMitnoles
06/21/2019, 3:58 PMkittinunf
06/22/2019, 6:06 AMkittinunf
06/22/2019, 6:06 AMRequest
if they want to ….kittinunf
06/22/2019, 6:06 AMResponse
and Result
in my opinionitnoles
06/22/2019, 6:15 AMNikky
06/22/2019, 9:33 AMitnoles
06/22/2019, 6:57 PMitnoles
06/22/2019, 6:58 PMitnoles
06/22/2019, 7:09 PMNikky
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