Vivek Modi
04/26/2022, 3:37 PMTim Oltjenbruns
04/26/2022, 3:43 PMsealed class ApiResult<out R, out E>
data class ApiSuccess<out R>(val value: R) : ApiResult<R, Nothing>()
data class ApiFailure<out E>(
val status: ApiErrorStatus,
val details: E?
) : ApiResult<Nothing, E>()
This is ours. It helps when you have domain specific error response bodies in addition to success bodies.Tim Oltjenbruns
04/26/2022, 3:44 PMTim Oltjenbruns
04/26/2022, 3:45 PMmike.holler
04/26/2022, 3:50 PMTim Oltjenbruns
04/26/2022, 3:51 PMmike.holler
04/26/2022, 3:52 PMTim Oltjenbruns
04/26/2022, 3:52 PMTim Oltjenbruns
04/26/2022, 3:53 PMVivek Modi
04/26/2022, 3:58 PMfetchResult
inside that code is checking every time response.code()
and route according to domain specific Success
or Error
body. Is there any better way it will automatically route on specific domain rather than checking every time.Tim Oltjenbruns
04/26/2022, 4:00 PMTim Oltjenbruns
04/26/2022, 4:00 PMVivek Modi
04/26/2022, 4:00 PMTim Oltjenbruns
04/26/2022, 4:00 PMVivek Modi
04/26/2022, 4:01 PMTim Oltjenbruns
04/26/2022, 4:01 PMTim Oltjenbruns
04/26/2022, 4:02 PMmike.holler
04/26/2022, 4:03 PMVivek Modi
04/26/2022, 4:03 PM