Socket
Socket
Sign inDemoInstall

retry-as-promised

Package Overview
Dependencies
0
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.0.0 to 6.0.0

21

index.js
'use strict';
var util = require('util');
var format = util.format;
function TimeoutError(message, err) {
Error.call(this);
Error.captureStackTrace(this, TimeoutError);
this.name = 'TimeoutError';
this.message = message;
this.previous = err;
class TimeoutError extends Error {
constructor(message, err) {
super(message);
this.name = "TimeoutError";
this.previous = err;
}
}
util.inherits(TimeoutError, Error);
function matches(match, err) {

@@ -94,7 +89,7 @@ if (match === true) return true;

options.$current++;
options.report(format('Retrying %s (%s)', options.name, options.$current), options);
options.report(`Retrying ${options.name} (${options.$current})`, options);
if (retryDelay) {
// Use backoff function to ease retry rate
options.report(format('Delaying retry of %s by %s', options.name, retryDelay), options);
options.report(`Delaying retry of ${options.name} by ${retryDelay}`, options);
backoffTimeout = setTimeout(function() {

@@ -101,0 +96,0 @@ retryAsPromised(callback, options)

{
"name": "retry-as-promised",
"version": "5.0.0",
"version": "6.0.0",
"description": "Retry a failed promise",

@@ -5,0 +5,0 @@ "main": "index.js",

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