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

Check whether a request can be retried based on the `error.code`


Version published
Weekly downloads
6.6M
increased by4.41%
Maintainers
2
Install size
5.42 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

Check whether a request can be retried based on the error.code

Install

$ npm install is-retry-allowed

Usage

import isRetryAllowed from 'is-retry-allowed';

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

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

isRetryAllowed({});
//=> true

API

isRetryAllowed(error)

error

Type: Error | object

The .code property, if it exists, will be used to determine whether retry is allowed.


Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Keywords

FAQs

Last updated on 17 Apr 2021

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