Moar Promises

node v6.17.1
version: 1.0.0
endpointsharetweet
await Promise.resolve() .then(() => { return Promise.resolve() .then(() => { throw new Error('poop') }); }) .catch((e) => `Don't worry I caught it`);
await Promise.resolve() .then(() => { Promise.resolve() .then(() => { throw new Error('poop') }); }) .then(() => `Oopsie poopsie!`) .catch((e) => `Don't worry I caught it`);
await Promise.resolve() .then(() => { throw new Error('doot'); }) .then(() => { return 'safe'; }, () => { return 'also safe'; }) .catch((e) => `Don't worry I caught it`);
Loading…

no comments

    sign in to comment