@lvce-editor/verror
TypeScript icon, indicating that this package has built-in type declarations

1.7.0 • Public • Published

VError

Improve error messages by adding additional context to an error.

Install

npm install @lvce-editor/verror

Usage

import { VError } from '@lvce-editor/verror'

const otherFunction = () => {
  throw new Error(`oops`)
}

const doSomething = () => {
  try {
    const data = otherFunction()
    return data
  } catch (error) {
    throw new VError(error, `failed to get data`)
  }
}

Gitpod

Open in Gitpod

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i @lvce-editor/verror

      Weekly Downloads

      17,698

      Version

      1.7.0

      License

      MIT

      Unpacked Size

      3.58 kB

      Total Files

      5

      Last publish

      Collaborators

      • levivilet