Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 days 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 (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-06T18:03:22.000Z (3 months ago)
- Last Synced: 2024-08-06T21:32:31.990Z (3 months ago)
- Topics: error, verror
- Language: TypeScript
- Homepage:
- Size: 179 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
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/lvce-editor/verror)