wvteijlingen / Spine

A Swift library for working with JSON:API APIs. It supports mapping to custom model classes, fetching, advanced querying, linking and persisting.
MIT License
266 stars 109 forks source link

Relies on statusCode to figure out whether a request failed #39

Closed kurko closed 8 years ago

kurko commented 9 years ago

This PR stops relying on NSURLSession.error and relies on the status code to figure whether a request failed or not. The reason is because in my app, .error is nil even when status code is 400. That was preventing .onFailure to ever be triggered.

Running the tests after the change, nothing broke, so I suppose everything's fine. Plus, my app is now working :D

wvteijlingen commented 8 years ago

The new Swift 2.0 version has improved error handling, so this is no longer needed. Thanks for the PR anyway! :)