Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

readiness-manager

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

readiness-manager - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

4

CHANGELOG.md
# CHANGELOG
## 1.1.0 (7 December 2020)
- Adding `attempt` over `ActionExecutionError`.
## 1.0.1 (3 December 2020)

@@ -4,0 +8,0 @@

2

package.json
{
"name": "readiness-manager",
"version": "1.0.1",
"version": "1.1.0",
"description": "👨‍💼 Define when your app is ready",

@@ -5,0 +5,0 @@ "keywords": [

@@ -80,5 +80,12 @@

```ts
type ActionErrorHandler = (error: ActionExecutionError, retry: ActionRetry) => void;
interface ActionExecutionError extends Error {
name: string;
stack: string;
attempt: number;
failReason: string;
}
type ActionRetry = () => Promise<void>;
type ActionErrorHandler = (error: ActionExecutionError, retry: ActionRetry) => void;
```

@@ -125,3 +132,3 @@

console.log(error);
if (count <= 1) retry();
if (error.attempt <= 1) retry();
});

@@ -128,0 +135,0 @@

@@ -16,3 +16,3 @@ /**

class ActionExecutionError extends Error {
constructor(name, error) {
constructor(name, attempt, error) {
super();

@@ -23,2 +23,3 @@

name,
attempt,
stack: error.stack,

@@ -25,0 +26,0 @@ failReason: error.message

@@ -138,8 +138,9 @@ const {

/**
* Tracks a given beacon action
* @param {Beacon} beacon
* Tracks a given beacon action.
* @param {Beacon} beacon - The beacon to execute.
* @param {Number} attempt - The attempt number of current beacon execution.
* @throws {ActionExecutionError}
* @private
*/
async [Symbols.execute](beacon) {
async [Symbols.execute](beacon, attempt = 1) {
const { name, action } = beacon;

@@ -165,4 +166,4 @@

this[Symbols.errorHandler](
new ActionExecutionError(name, error),
() => this[Symbols.execute](beacon)
new ActionExecutionError(name, attempt, error),
() => this[Symbols.execute](beacon, attempt + 1)
);

@@ -169,0 +170,0 @@ }

@@ -18,2 +18,3 @@ type ReadyCallback = () => void;

stack: string;
attempt: number;
failReason: string;

@@ -20,0 +21,0 @@ }

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc