Skip to content

Improve error messages by adding additional context to an error.

License

Notifications You must be signed in to change notification settings

lvce-editor/verror

Repository files navigation

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

About

Improve error messages by adding additional context to an error.

Topics

Resources

License

Stars

Watchers

Forks