Skip to content

Instantly share code, notes, and snippets.

@tmpaul06
Last active July 6, 2017 07:11
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 tmpaul06/5d0c153097494d5f840e961de552226a to your computer and use it in GitHub Desktop.
Save tmpaul06/5d0c153097494d5f840e961de552226a to your computer and use it in GitHub Desktop.
Promise error handling
getMoneyFromAccount()
// buyMangoes here will throw an Error
.then(buyMangoes, dadBranch)
// Next handler in chain
.then(eatMangoes, handleThief)
The `handleThief` function is called when buyMangoes throws an exception
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment