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