Skip to content

Instantly share code, notes, and snippets.

@deepal
Created April 27, 2019 13:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save deepal/c7b29bd3d1bf4456dca4225d9ec1f95e to your computer and use it in GitHub Desktop.
Save deepal/c7b29bd3d1bf4456dca4225d9ec1f95e to your computer and use it in GitHub Desktop.
function myAsyncFunction(callback) {
setTimeout(() => {
callback(new Error('oops'))
}, 1000);
}
myAsyncFunction((err) => {
if (err) {
// handle error
} else {
// happy path
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment