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

try catch for writeStagedState serialize #1

Merged
merged 1 commit into from
Jun 17, 2021

Conversation

SethArchambault
Copy link
Collaborator

Even though there was ".catch" on this line, it only caught errors from setItem, so an error from serialize would be completely unhandled.

This will at least give a more helpful error message than this raw error:

RangeError: Out of memory
  at stringify([native code])
  at writeStagedState(node_modules/redux-persist/lib/createPersistoid.js:90:48)
  at processNextKey(node_modules/redux-persist/lib/createPersistoid.js:78:7)
  at _callTimer(node_modules/react-native/Libraries/Core/Timers/JSTimers.js:130:7)
  at apply(node_modules/react-native/Libraries/Core/Timers/JSTimers.js:383:7)
  at __callFunction(node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:416:27)
  at fn(node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:109:12)
  at __guard(node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:364:9)
  at value(node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:108:10)
  at value([native code])

Even though there was ".catch" on this line, it only caught errors from setItem, so an error from serialize would be completely unhandled.
@SethArchambault
Copy link
Collaborator Author

Note that this needs some testing..

@SethArchambault SethArchambault merged commit 62b500c into master Jun 17, 2021
@SethArchambault SethArchambault deleted the SethArchambault-serialize-trycatch-patch-1 branch June 17, 2021 18:43
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.

1 participant