Skip to content

Instantly share code, notes, and snippets.

@csharpforevermore
Created November 5, 2018 00:12
Show Gist options
  • Save csharpforevermore/bce4adea2f2539132d06bb8a88e00d82 to your computer and use it in GitHub Desktop.
Save csharpforevermore/bce4adea2f2539132d06bb8a88e00d82 to your computer and use it in GitHub Desktop.
Useful error handling of promises and catches
const handle = promise => promise
.then(res => [null, res])
.catch(err => [err, null]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment