@calipsa/wrap-error

Wrapped error for Node.js

Usage no npm install needed!

<script type="module">
  import calipsaWrapError from 'https://cdn.skypack.dev/@calipsa/wrap-error';
</script>

README

@calipsa/wrap-error

NPM version Downloads Dependency status Dev Dependency status

Installation

# using npm:
npm install --save @calipsa/wrap-error

# or if you like yarn:
yarn add @calipsa/wrap-error

Usage

import wrapError from '@calipsa/wrap-error'

fs.readFile('incorrect path', (err, data) => {
  if (err) {
    throw wrapError(err, 'Failed to read file')
  }
  // ...
})