Skip to content

Instantly share code, notes, and snippets.

@fwielstra
Created December 18, 2012 09:30
Show Gist options
  • Save fwielstra/4326617 to your computer and use it in GitHub Desktop.
Save fwielstra/4326617 to your computer and use it in GitHub Desktop.
wrapError replacement for backbone.js
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