androidperformancekotlinandroid-mvvmandroid-architecture

The better way of Error Handling In Android


Let's say I have this architecture in my app Architecture

My question is when is the best time to handle the error?

  1. Should I let the network source and cache source throw an error, and we handle all the possible error in the repository layer
  2. Should I handle the error in the framework-specific, and return a sealed class that present is the network call error or success

Solution

  • Depends on the use case