Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
Moar Promises
node v6.17.1
version:
1.0.0
endpoint
share
tweet
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