Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove non-serializable objects from error.userData when request fails #109

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

akshetpandey
Copy link
Contributor

error.userData may contain NSURL which doesn't serialize and causes a crash.

if (callback) {
// Ensure error.userData can be converted to JSON without error.
// This will remove any NSURL from the error.userData.
error = RCTErrorClean(error);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be upstream in react-native? they should handle NSURL in RCTJSErrorFromNSError?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, but upstreaming it and waiting for merge will take pretty long and till then this method will crash.

I will try to get fb to merge a change to support NSURL too

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed. let's get a PR upstream. once it's merged upstream, we can add a fallback here. If it's not merged upstream in x time, then let's ship here.

that works for you?

@chirag04
Copy link
Owner

@akshetpandey any update?

@chirag04
Copy link
Owner

chirag04 commented Dec 1, 2017

@akshetpandey ping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants