Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix private browsing issue #44
How about calling
Also, would you mind minifying it? I left instructions on how to do so here: http://documentup.com/jeromegn/backbone.localstorage#contributing
Ideally, you'd create a test for this, basically stubbing localStorage with something that throws the error (temporarily) and test if it's caught and sent back the right way. I can see how this might be a bit much though ;)
What's wrong with the solution proposed here: marcuswestin/store.js#42 (comment)?
I think the author's comments there apply in this case as well. It should not be the library's responsibility to detect this issue. Your fix hides the actual issue (localStorage isn't available) and so instead it appears as though it's just a regular error.
That was just a quick fix that we can improve for sure.
@jeromegn Yes, calling
@gsmaverick Correct me if I'm wrong but the original Backbone.sync implementation will call