Has someone built a datatype adapter for retrofit?...
# android
c
Has someone built a datatype adapter for retrofit? similar to the suspend native one but like
fun getModel() : Either<Model, APIError>
b
isn't
Response<Model>
what you want?
Copy code
if (response.isSuccessful) {
  // response.body() <- Model
} else {
  // response.code() <- Api code
}
c
I´m using the suspend fun right now, and in the case of error I´m handling the error and building the datatype
it´s kinda different
Wanted to make it automatic from the service interface with an adapter