Skip to content

Instantly share code, notes, and snippets.

@hexode
Created November 18, 2016 17:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hexode/6e026efc19afc2be9f4c9fb08ad6077b to your computer and use it in GitHub Desktop.
Save hexode/6e026efc19afc2be9f4c9fb08ad6077b to your computer and use it in GitHub Desktop.
Handling error in promises
new Promise.reject(new CustomError())
.catch(handleError(CustomError, () => {
}))
.catch(handleError(AnotherError, () => {
}))
.catch(handleError(Error, () => {
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment