Created
December 18, 2012 09:30
-
-
Save fwielstra/4326617 to your computer and use it in GitHub Desktop.
wrapError replacement for backbone.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sync = Backbone.sync; | |
Backbone.sync = function(method, model, options) { | |
if (!options.error) { | |
options.error = function(method, model, options) { | |
// custom error handling here. | |
} | |
} | |
}; | |
sync(method, model, options); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment