Last active
August 29, 2015 14:22
-
-
Save timestep/11fd59e22c6b1d8f82a2 to your computer and use it in GitHub Desktop.
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 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