Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle network exception in data layer #6

Open
ArezooNazer opened this issue Mar 7, 2021 · 1 comment
Open

Handle network exception in data layer #6

ArezooNazer opened this issue Mar 7, 2021 · 1 comment

Comments

@ArezooNazer
Copy link

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?

@shipsywor
Copy link

@ArezooNazer You can wrap the List<ApiUser> with Response<List<ApiUser>>

Response is from Retrofit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants