try { const res = await asyncFunction(); } catch (err) { throw err; }
Use await-to-js library
const [err, res] = await to(asyncFunction()); if (err) { throw err; }
try { const res = await asyncFunction(); } catch (err) { throw err; }
Use await-to-js library
const [err, res] = await to(asyncFunction()); if (err) { throw err; }