Created
November 13, 2018 12:25
-
-
Save gisderdube/fc78d0f9db8ad6fc73d08a33bac0ce0a to your computer and use it in GitHub Desktop.
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
Promise.resolve(1) | |
.then(res => { | |
console.log(res) // 1 | |
throw new Error('something went wrong') | |
return Promise.resolve(2) | |
}) | |
.then(res => { | |
console.log(res) // will not get executed | |
}) | |
.catch(err => { | |
console.error(err) // we will see what to do with it later | |
return Promise.resolve(3) | |
}) | |
.then(res => { | |
console.log(res) // 3 | |
}) | |
.catch(err => { | |
// in case in the previous block occurs another error | |
console.error(err) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment