steve1rm / BusbySurvey

Fetches and conducts a user suvery
MIT License
0 stars 0 forks source link

No proper error handling #20

Open luongvo opened 1 month ago

luongvo commented 1 month ago
steve1rm commented 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.

steve1rm commented 1 month ago
  • 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.