Exception handling - devrath/DroidKotlinCleanArchitecture GitHub Wiki
Types of error we have
We will have a sealed class as a base class describing possible errors
Network Error
- > Possibly due to no connectivityServer Error
- > Possibly due to many scenarios like endpoint not existing etcFeature Error
- > These are specific to a particular feature, Every feature-specific failure should extend the [FeatureFailure] class.
Parent class for the errors
sealed class Failure {
object NetworkConnection : Failure()
object ServerError : Failure()
/** * Extend this class for feature specific failures.*/
abstract class FeatureFailure : Failure()
}