Can I catch an error from async without using await?

Dealing with unhandled rejected native promises (and async/await uses native promises) is a feature supported now in V8. It’s used in the latest Chrome to output debugging information when a rejected promise is unhandled; try the following at the Babel REPL: async function executor() { console.log(“execute”); } async function doStuff() { console.log(“do stuff”); throw new …

Read more

Bluebird, promises and then()

Welcome to the wonderful world of promises. How then works in your example Your assertion in 1 is correct. We can simulate a promise resolving in Bluebird using Promise.resolve on a value. Let’s show this: Let’s get a function that returns a promise: function foo(){ return Promise.resolve(“Value”); } foo().then(alert); This short snippet will alert “Value” …

Read more