Last active
May 8, 2018 19:29
-
-
Save llinardos/27ec21aca6e562e966f199f5ebb6e319 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
class ThingsService { | |
func getThings() -> Result<[Thing]> { | |
do { | |
let response = try sendHttpRequestSynchronously(url) | |
let data = try getData(from: response) | |
let things = try doParsing(data) | |
return .success(things) | |
} catch error { | |
return .failure(error) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment