Skip to content

Instantly share code, notes, and snippets.

@timestep
Last active August 29, 2015 14:22
Show Gist options
  • Save timestep/11fd59e22c6b1d8f82a2 to your computer and use it in GitHub Desktop.
Save timestep/11fd59e22c6b1d8f82a2 to your computer and use it in GitHub Desktop.
var makeErrorHandler = function (msg) {
//msg is the string passed via the call
//the return anonyumous function is what is passed back to the callback of getData
return function (error) {
sendErrorToServer(error);
showMessage(msg);
};
};
getData(query, function (result) {
//success
}, makeErrorHandler ('Could Not Get Data'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment