Last active
August 17, 2016 11:10
-
-
Save macbaszii/4d2ff203c486811962a76cbb9b06d3d2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
import ObjectMapper | |
public protocol APIError: Mappable { | |
var type: String? { get set } | |
var message: String? { get set } | |
} | |
public class ExampleAPIError: APIError { | |
public var type: String? | |
public var message: String? | |
required public init?(_ map: Map) { | |
} | |
public func mapping(map: Map) { | |
type <- map["error.type"] | |
message <- map["error.message"] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment