try { await Promise.resolve(1).then(v => { throw new Error("oops"); }); } catch (e) { console.log("caught:" + e.message); }