Skip to content

Instantly share code, notes, and snippets.

@darrinholst
Created September 9, 2008 16:11
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 darrinholst/9700 to your computer and use it in GitHub Desktop.
Save darrinholst/9700 to your computer and use it in GitHub Desktop.
function genericErrorHandling() {
alert('do generic error handling here');
}
Ajax.Base.prototype.initialize = Ajax.Base.prototype.initialize.wrap(function(p, options) {
p(options);
this.options.onFailure = this.options.onFailure || genericErrorHandling;
});
new Ajax.Request('somepage', {
onSuccess: doSomething,
on400: handleBadRequest
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment