AFNetworking-RACExtensions icon indicating copy to clipboard operation
AFNetworking-RACExtensions copied to clipboard

Added NSError category for Reactive programming

Open Legoless opened this issue 9 years ago • 6 comments

Added NSError convenience category, to pull information from NSError instances sent by ReactiveCocoa when requests fail. This is to remove boilerplate code you get when trying to handle specific NSError instance in case of networking failure.

Legoless avatar Mar 30 '15 10:03 Legoless

So wait, is this a file from AFNetworking or did you write this yourself?

CodaFi avatar Mar 30 '15 13:03 CodaFi

This is a file I wrote myself when using your library. I submitted it to AFNetworking main repo, but according to owner they do not want to pollute the global namespace with category methods. Usually this is not needed much with main AFNetworking blocks as you get operation which contains these objects on the fly. In this case we only get NSError when subscribed and it is annoying to pull out information from it (some boilerplate code). This category removes that.

Legoless avatar Mar 30 '15 14:03 Legoless

Then I have to request some things of you:

  • Change the license to MIT. I can't merge anything with the AFN license, it's a hassle.
  • Re-namespace everything. I use raf to avoid AFNetworking's stuff
  • Adhere to the code style of the rest of the files.

I'll leave more specific notes in line comments.

CodaFi avatar Mar 30 '15 15:03 CodaFi

Okay, I'll update this. Just wondering did you mean "raf" or "rac"? Cause it seems it should be prefixed with rac, not raf.

Legoless avatar Mar 30 '15 19:03 Legoless

Hm... Yeah, I meant rac.

CodaFi avatar Mar 30 '15 20:03 CodaFi

Updated, check if all good. :) Thanks.

Legoless avatar Mar 31 '15 17:03 Legoless