Skip to content

Instantly share code, notes, and snippets.

@courtneymyers
Created February 1, 2018 23:20
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 courtneymyers/b6f63095848dbe6979de03dafee92c62 to your computer and use it in GitHub Desktop.
Save courtneymyers/b6f63095848dbe6979de03dafee92c62 to your computer and use it in GitHub Desktop.
Higher order function to pass to Promise w/ .catch() to handle errors
const handleError = fn => (...params) => fn(...params).catch(err => console.error(err));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment