1.4.0 • Published 3 months ago

@lvce-editor/verror v1.4.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 months ago

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