[swift] Validate response; return error in case if non 2xx status.

This commit is contained in:
Tomek Cejner
2016-04-15 16:35:22 +02:00
parent 51d254973a
commit 1fa5c73dcc

View File

@@ -75,7 +75,7 @@ class AlamofireRequestBuilder<T>: RequestBuilder<T> {
request.authenticate(usingCredential: credential)
}
request.responseJSON(options: .AllowFragments) { response in
request.validate().responseJSON(options: .AllowFragments) { response in
managerStore.removeValueForKey(managerId)
if response.result.isFailure {