Kotlin-Coroutines-Android-Examples
Kotlin-Coroutines-Android-Examples copied to clipboard
Handle network exception in data layer
In this project, the network exceptions are handled in ViewModel and it's not a good approach. How can we handle network errors such as 404, 500, etc inside of the repository?
@ArezooNazer You can wrap the List<ApiUser> with Response<List<ApiUser>>
Response is from Retrofit.