Tower Guidev2
07/11/2022, 11:05 AMio.arrow-kt:arrow-core-retrofit
in my android application 🤦♂️if (response.isSuccessful && response.code() == HttpURLConnection.HTTP_OK) {
} else manageHTTPError(response)
where response is retrofit2.Response
Either<NetworkException, Response<UserInfoResponse>>
in my retrofit API interface?stojan
07/11/2022, 11:47 AMEither<ErrorBody, SuccessBody>
2xx response codes get deserialised into SuccessBody
and other HTTP codes (errors) get deserialised into ErrorBody
IOException
) still throwTower Guidev2
07/12/2022, 8:14 AMprivate const val GOOGLE_CONNECTIVITY_CHECK_URL = "<https://connectivitycheck.gstatic.com/generate_204>"
ResponseE<ErrorBody, SuccessBody>
where ResponseE
is like Response
from retrofit but has an Either
for success/error