Socket
Socket
Sign inDemoInstall

is-retry-allowed

Package Overview
Dependencies
0
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    is-retry-allowed

Is retry allowed for Error?


Version published
Weekly downloads
6.3M
increased by6.49%
Maintainers
2
Install size
4.52 kB
Created
Weekly downloads
 

Package description

What is is-retry-allowed?

The is-retry-allowed npm package is used to determine if a given error is transient and likely to be resolved by retrying the failed operation. It checks the error against a list of known transient errors and returns a boolean indicating whether a retry should be allowed.

What are is-retry-allowed's main functionalities?

Check if a retry is allowed for a given error

This feature allows you to pass an error object to the isRetryAllowed function, which returns true if the error is considered transient and retryable, or false otherwise.

const isRetryAllowed = require('is-retry-allowed');

const error = new Error('ECONNRESET');
const shouldRetry = isRetryAllowed(error);
console.log(shouldRetry); // Output: true

Other packages similar to is-retry-allowed

Readme

Source

is-retry-allowed Build Status

Is retry allowed for Error?

Install

$ npm install --save is-retry-allowed

Usage

const isRetryAllowed = require('is-retry-allowed');

isRetryAllowed({code: 'ETIMEDOUT'});
//=> true

isRetryAllowed({code: 'ENOTFOUND'});
//=> false

isRetryAllowed({});
//=> true

API

isRetryAllowed(error)

error

Type: object

Object with code property, which will be used to determine retry.

License

MIT © Vsevolod Strukchinsky

FAQs

Last updated on 08 Sep 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc