stojan
04/25/2020, 1:06 PMCallAdapter
that would work with:
interface Service {
@GET("/")
suspend fun bodyEither(): Either<String, String>
@GET("/")
suspend fun bodyResponseE(): ResponseE<String, String>
}
// a more FP/Kotlin friendly version of retrofit2.Response
data class ResponseE<E, A>(
val raw: okhttp3.Response,
val code: Int,
val message: String?,
val headers: Headers,
val body: Either<E, A>
) {
val isSuccessful: Boolean = raw.isSuccessful
}
where the you can put the error body on the left. Would that be a good fit for arrow-integrations
?raulraja
04/25/2020, 2:48 PMraulraja
04/25/2020, 2:48 PMHarryPulvirenti
04/25/2020, 5:31 PMstojan
04/25/2020, 5:58 PMHiosdra
04/29/2020, 9:43 AM@GET("/")
fun getUser(): IO<E, T>
Where T will be the same as T in:
fun getUser(): Mono<T>
And E will be ??? Maybe retrofit’s HttpException?stojan
04/29/2020, 10:15 AMstojan
04/29/2020, 10:16 AMHiosdra
04/29/2020, 10:32 AMraulraja
04/29/2020, 12:32 PMraulraja
04/29/2020, 12:33 PMraulraja
04/29/2020, 12:33 PM