Skip to content

Instantly share code, notes, and snippets.

@vnglst
Created April 15, 2019 18:04
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 vnglst/092c10af183782d02d92a10bf31cd61a to your computer and use it in GitHub Desktop.
Save vnglst/092c10af183782d02d92a10bf31cd61a to your computer and use it in GitHub Desktop.
module.exports.catchErrors = function catchErrors(fn) {
return function(...args) {
return fn(...args).catch(err => {
console.error(err)
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment