Promises & then/catch
How does error handling work in Promise chains?
promise
.then(value => {
throw new Error('Something went wrong');
})
.then(value => console.log('Never called'))
.catch(error => console.error(error));
promise
.then(value => {
throw new Error('Something went wrong');
})
.then(value => console.log('Never called'))
.catch(error => console.error(error));