-
-
Save raamcosta/002c725da155d32e3d3dc48eab0d92c9 to your computer and use it in GitHub Desktop.
Error handling - Common approach
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sealed class Result<T> { | |
data class Success<T>(val data: T) : Result<T>() | |
data class Error<T>(val error: SomeErrorType) : Result<T>() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment