morcmarc / react-native-cognito

AWS Cognito integration module for React Native
MIT License
63 stars 10 forks source link

Replaced NSError in callback with NSDictionary #3

Closed timothytripp closed 8 years ago

timothytripp commented 8 years ago

Returning an NSError (task.error) in the callback was causing the following error: RCTJSONStringify() encountered the following error: Invalid type in JSON write (NSError) in RCTUtils.m (react-native v0.20.0). In react-native 0.18.0 a SIGABT signal was raised. Since JSON can’t parse an NSError, the contents of the NSError are first converted to an NSDictionary which JSONStringify can process correctly. For convenience, the localizedDescription is also added to the dictionary (it’s also usually present in the userInfo.localizedDescription value, but userInfo can be null)

morcmarc commented 8 years ago

Thanks for the pull request. I'll do a release tomorrow.