Home

Awesome

transient-error

Mark an error as transient, meaning you can retry.

npm status node Travis build status JavaScript Style Guide

Usage

const transient = require('transient-error')
const err = transient(new Error('Could not connect'))

A consumer can then do:

if (err.transient) {
  // Retry
}

Becomes useful when multiple modules use this, as a simple contract.

Install

With npm do:

npm install transient-error

License

MIT © 2020-present Vincent Weevers