Created
August 17, 2016 09:34
-
-
Save macbaszii/9a0e4f7d92848471c4182cc358eb2ee4 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
| switch response.statusCode { | |
| case 200..<400: | |
| break | |
| default: | |
| if let errorParsed = Mapper<E>().map(JSONToMap) { | |
| let failureReason = errorParsed.message | |
| let error = newError(.EndpointError, failureReason: | |
| failureReason ?? DefaultErrorMessage) | |
| return .Failure(error) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment