https://github.com/lvce-editor/verror
Improve error messages by adding additional context to an error.
https://github.com/lvce-editor/verror
error verror
Last synced: 3 months ago
JSON representation
Improve error messages by adding additional context to an error.
- Host: GitHub
- URL: https://github.com/lvce-editor/verror
- Owner: lvce-editor
- License: mit
- Created: 2023-08-20T19:16:55.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-22T13:15:57.000Z (3 months ago)
- Last Synced: 2025-02-22T14:23:26.953Z (3 months ago)
- Topics: error, verror
- Language: TypeScript
- Homepage:
- Size: 244 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# VError
Improve error messages by adding additional context to an error.
## Install
```sh
npm install @lvce-editor/verror
```## Usage
```js
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
[](https://gitpod.io/#https://github.com/lvce-editor/verror)