Created
July 31, 2017 08:26
-
-
Save knownothingsnow/388d6098796a9bed758e011bd1070901 to your computer and use it in GitHub Desktop.
break-promise
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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