Open luongvo opened 1 month ago
- All
APIResponse.OnFailure
results are being caught and emitting the error state as a boolean flag to the UI layer. There are no actual error handling to check the error throwable instance to notify the corresponding message from API response (wrong authentication, no internet, timeout, etc) to the user instead of a generic one (e.g,Check our email or password
) for all error types.
Yes, the login result should return the error associated with the request.
- Which component will catch the error throwing from the repository layer? Will the app crash?
This is something that should not happen. However, throw exceptions do have there place to avoid putting the app in to a inconsistent state. That might also be debatable.
All
APIResponse.OnFailure
results are being caught and emitting the error state as a boolean flag to the UI layer. There are no actual error handling to check the error throwable instance to notify the corresponding message from API response (wrong authentication, no internet, timeout, etc) to the user instead of a generic one (e.g,Check our email or password
) for all error types. https://github.com/steve1rm/BusbyNimbleSurvey/blob/5b80ada6d22093fc66d36debe028eaa15cc4886e/presentation/src/main/java/me/androidbox/presentation/authentication/login/LoginViewModel.kt#L58-L64Which component will catch the error throwing from the repository layer? Will the app crash? https://github.com/steve1rm/BusbyNimbleSurvey/blob/5b80ada6d22093fc66d36debe028eaa15cc4886e/data/src/main/java/me/androidbox/data/repository/AuthorizationRepositoryImp.kt#L54-L56