AFNetworking/AFNetworking — pull request #1390 by gfiumara (2013-09-29 15:20:31+00:00)
Title: Pass data in error object for failed responses (2.0 regression)

In AFNetworking 1.x, the `NSError` parameter of the `failure` block of `AFHTTPClient` convenience methods (`getPath:`, etc.) would report the body of the failed response in its `userInfo` property's `NSLocalizedRecoverySuggestionErrorKey` key. It was set in `AFHTTPRequestOperation` `-error:`. This no longer happens in 2.0's `AFHTTPSessionManager` convenience method `failure` callbacks (ultimately, it's missing from `NSURLResponseSerialization` `-validateResponse:data:error:`).

If this is by design, the [Migration Guide](https://github.com/AFNetworking/AFNetworking/wiki/AFNetworking-2.0-Migration-Guide) should be updated to reflect that `failure` block `NSError` handling code will need to be overhauled.

Note that in 1.x, the body was reported as a string, but as far as I can tell, the serializer does not have access to a string version of the body. If the string cannot be reported back, then there could be a crash when developers interact with the contents of `NSLocalizedRecoverySuggestionErrorKey`.

Possible regression of #83?