ts-retry-promise
Advanced tools
Comparing version 0.7.1 to 0.8.0
@@ -23,3 +23,4 @@ export interface RetryConfig<T = any> { | ||
declare class BaseError { | ||
constructor(...args: unknown[]); | ||
message?: string | undefined; | ||
constructor(message?: string | undefined, ...args: unknown[]); | ||
} | ||
@@ -26,0 +27,0 @@ export declare class NotRetryableError extends BaseError { |
@@ -194,7 +194,8 @@ "use strict"; | ||
var BaseError = /** @class */ (function () { | ||
function BaseError() { | ||
function BaseError(message) { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
for (var _i = 1; _i < arguments.length; _i++) { | ||
args[_i - 1] = arguments[_i]; | ||
} | ||
this.message = message; | ||
Error.apply(this, args); | ||
@@ -201,0 +202,0 @@ } |
{ | ||
"name": "ts-retry-promise", | ||
"version": "0.7.1", | ||
"version": "0.8.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "retry for functions returning a promise", |
# ts-retry-promise # | ||
[![Build Status](https://github.com/normartin/ts-retry-promise/workflows/Node.js%20CI/badge.svg)](https://github.com/normartin/ts-retry-promise/actions?query=workflow%3A%22Node.js+CI%22) | ||
[![Build Status](https://github.com/normartin/ts-retry-promise/workflows/Build/badge.svg?branch=master)](https://github.com/normartin/ts-retry-promise/actions/workflows/ci.yml?query=branch%3Amaster) | ||
[![Coverage Status](https://coveralls.io/repos/github/normartin/ts-retry-promise/badge.svg?branch=master)](https://coveralls.io/github/normartin/ts-retry-promise?branch=master) | ||
@@ -124,4 +124,4 @@ [![Dependencies](https://img.shields.io/badge/Dependencies-none-brightgreen)](https://github.com/normartin/ts-retry-promise/blob/master/package.json) | ||
retry(async () => throw new NotRetryableError("This error")) | ||
.catch(err => console.log(err.lastError), { retries: 'INFINITELY' }); | ||
retry(async () => { throw new NotRetryableError("This error") }, { retries: 'INFINITELY' }) | ||
.catch(err => console.log(err.lastError.message)); // will print "This error" | ||
``` | ||
@@ -128,0 +128,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26897
270