kastiglione / Parse-RACExtensions

ReactiveCocoa for Parse
MIT License
61 stars 9 forks source link

Remove Parse SDK NSError* Normalization? #16

Closed mhupman closed 10 years ago

mhupman commented 10 years ago

PFRACCallbacks.m#L16 looks like it was written to handle a situation where the NSError* returned from the ParseSDK didn't set the NSLocalizedDescriptionKey and instead stuffed the string representation of the underlying error into userInfo[@"error"]

However, NSErrors returned by ParseSDK 1.2.15+ do have a localizedDescription set. So, the question is, should we remove PFRACNormalizeError completely? Alternatively, we could leave it in place but modify it to only handle the error == nil case.

FWIW, I checked the Parse iOS SDK release notes but didn't see anything about a change in how NSError were generated, so I'm assuming this code was originally written as a workaround for a time when Parse SDK errors did not include a localized description.

kastiglione commented 10 years ago

Definitely shouldn't be blindingly assigning to NSLocalizedDescriptionKey like that!

I'm fine with removing it altogether and passing through even nil errors. I was only concerned with surfacing the value under the @"error" key.

mhupman commented 10 years ago

Ok, I'll work on removing it. It would be nice if the Parse iOS SDK populated the NSUnderlyingErrorKey with the actual NSError* object. As it stands, the string representation in @"error" isn't suitable for user presentation or parsing.

kastiglione commented 10 years ago

Closed by #17.