-
-
Save raamcosta/453cbb546f1fa5912e0772bee11c41a2 to your computer and use it in GitHub Desktop.
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 interface GetMagicCardUseCaseError | |
object InvalidCardNameFormat : GetMagicCardUseCaseError | |
sealed interface ApiCallError : GetMagicCardUseCaseError | |
class HttpUnsuccessfulCodeError(val httpCode: Int) : ApiCallError | |
object RemoteServerNotReachedError : ApiCallError | |
object UnexpectedApiCommunicationError : ApiCallError | |
fun handleError(error: GetMagicCardUseCaseError) { | |
when (error) { | |
is HttpUnsuccessfulCodeError -> //TODO | |
is RemoteServerNotReachedError -> //TODO | |
is UnexpectedApiCommunicationError -> //TODO | |
is InvalidCardNameFormat -> //TODO | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment