1new Promise((resolve, reject) => {
2 console.log('Initial');
3
4 resolve();
5})
6.then(() => {
7 throw new Error('Something failed');
8
9 console.log('Do this');
10})
11.catch(() => {
12 console.error('Do that');
13})
14.then(() => {
15 console.log('Do this, no matter what happened before');
16});
17