A tool method to catch async function errors.
$ npm install async-error-captured --save Or
$ yarn add async-error-captured const errorCaptured = require('async-error-captured'); const handleFunc = async () => { const [err, res] = await errorCaptured(asyncFunc, args1, args2, ...); if (err) { throw new Error(err); } console.log(res); }MIT