Created
April 6, 2022 13:28
-
-
Save meyusufdemirci/b66ff678fbd5959efab8b01469427feb to your computer and use it in GitHub Desktop.
Error Handling Article
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
enum MainError: Error { | |
case general | |
case networkError(NetworkError) | |
var userFriendlyDescription: String { | |
switch self { | |
case .networkError(let error): | |
return error.userFriendlyDescription | |
default: | |
return "MainError.general".localized | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment