Skip to content

Instantly share code, notes, and snippets.

@knownothingsnow
Created July 31, 2017 08:26
Show Gist options
  • Save knownothingsnow/388d6098796a9bed758e011bd1070901 to your computer and use it in GitHub Desktop.
Save knownothingsnow/388d6098796a9bed758e011bd1070901 to your computer and use it in GitHub Desktop.
break-promise
fetch('https://stackoverflow.com')
.then(res => {
console.log('step1', res)
})
.then(res => {
console.log('step2')
throw new Error('borken here')
})
.then(res => {
console.log('step3')
})
.catch(e => {
console.warn('cancel')
throw e
})
.then(() => {
console.log('step4')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment