async-error-captured

1.0.0 • Public • Published

async-error-captured

A tool method to catch async function errors.

install

$ npm install async-error-captured --save

Or

$ yarn add async-error-captured

Usage

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);
}

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i async-error-captured

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

174 kB

Total Files

5

Last publish

Collaborators

  • checkson