Let's say I have this architecture in my app

My question is when is the best time to handle the error?
- Should I let the network source and cache source throw an error, and we handle all the possible error in the repository layer
- Should I handle the error in the framework-specific, and return a sealed class that present is the network call error or success
Depends on the use case
UIto notify user to make sure user won't just see a blank screen or experience unexpected UI. You can sealed classes in Kotlin for this case.