Last active
August 29, 2015 14:23
-
-
Save mxcl/f5335918d4876f7ed435 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
firstly { | |
NSURLSession.GET(url) | |
}.then { (dict: NSDictionary) in | |
//… | |
}.catch { (err: Error.JSONError) in | |
// The token `JSONError` is defined in PromiseKit | |
}.catch { (err: Error.HTTPError) in | |
switch err.statusCode { | |
case 400: //… | |
//… | |
} | |
}.finally { | |
//… | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment