Created
February 21, 2019 01:09
-
-
Save ekscrypto/31e32fa4b840277a23ad36ec1898c6bd 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
import Foundation | |
protocol APIEndpoint { | |
func endpoint() -> String | |
} | |
class APIRequest { | |
struct ErrorResponse: Codable { | |
let status: String | |
let code: Int | |
let message: String | |
} | |
enum APIError: Error { | |
case invalidEndpoint | |
case errorResponseDetected | |
case noData | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment