Created
October 19, 2019 14:24
-
-
Save isaac-weisberg/eddb02704fcc0dd9cf68b78ef6b3bf2e 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
extension DataDownloadServiceError: ErrorTitledSingularRepresentable { | |
var errorTitleSingular: ErrorTitledSingularType { | |
switch self { | |
case .noData: | |
return ErrorTitledSingular("Yikes!", "The server must be hung over tbh") | |
case .invalidResponseType: | |
return ErrorTitledSingular("Darn", "Ooops, guess we've goofed up") | |
case .networkError(let error): | |
return ErrorTitledSingular("Error", error.localizedDescription) | |
case .unexpectedStatusCode(let code): | |
return ErrorTitledSingular("Failure", "The server has responded with status code \(code)-- no idea like-- what?") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment