Skip to content

Instantly share code, notes, and snippets.

@fwielstra
Created December 18, 2012 09:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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