Skip to content

Instantly share code, notes, and snippets.

@murattuzel
Created November 14, 2021 20:16
Show Gist options
  • Save murattuzel/47ba603479b075baa42933d3fb391b68 to your computer and use it in GitHub Desktop.
Save murattuzel/47ba603479b075baa42933d3fb391b68 to your computer and use it in GitHub Desktop.
Error types.
sealed class Failure : IOException()
object JsonError : Failure()
object UnknownHostError : Failure()
object NoConnectivityError : Failure()
data class TimeOutError(
override val message: String?
) : Failure()
data class UnknownError(
val throwable: Throwable
) : Failure()
data class HttpError(
val code: Int,
override val message: String
) : Failure()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment