new Promise(() => { console.log(1); }) .then(() => { console.log(2); throw new Error('problem'); }) .then(() => { console.log(3); }) .catch(() => { console.log(4); });
then