https://github.com/vweevers/transient-error
Mark an error as transient, meaning you can retry.
https://github.com/vweevers/transient-error
error nodejs npm-package retry temporary transient
Last synced: about 1 year ago
JSON representation
Mark an error as transient, meaning you can retry.
- Host: GitHub
- URL: https://github.com/vweevers/transient-error
- Owner: vweevers
- License: mit
- Created: 2020-03-27T10:45:28.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-27T11:05:27.000Z (about 6 years ago)
- Last Synced: 2025-04-24T22:58:34.426Z (about 1 year ago)
- Topics: error, nodejs, npm-package, retry, temporary, transient
- Language: JavaScript
- Homepage:
- Size: 1.95 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# transient-error
> **Mark an error as transient, meaning you can retry.**
[](https://www.npmjs.org/package/transient-error)
[](https://www.npmjs.org/package/transient-error)
[](http://travis-ci.org/vweevers/transient-error)
[](https://standardjs.com)
## Usage
```js
const transient = require('transient-error')
const err = transient(new Error('Could not connect'))
```
A consumer can then do:
```js
if (err.transient) {
// Retry
}
```
Becomes useful when multiple modules use this, as a simple contract.
## Install
With [npm](https://npmjs.org) do:
```
npm install transient-error
```
## License
[MIT](LICENSE.md) © 2020-present Vincent Weevers