I'm just playing around with async/await in node and it seems that if you're awaiting a promise and it gets rejected that it throws. I'm wondering if there is a cleaner pattern than going back to try/catch blocks that I'm not aware of?
async function foo() {
const val = await Promise.reject();
}
try
/catch()
is the cleaner pattern, aligning synchronous and asynchronous error handling:(Works in Chrome and Firefox Developer Edition at the moment)