@wmfs/statebox
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -198,3 +198,3 @@ 'use strict' | ||
const stateToRun = stateMachine.states[executionDescription.currentStateName] | ||
stateToRun.runTaskFailure(executionDescription, options) | ||
return stateToRun.runTaskFailure(executionDescription, options) | ||
} else { | ||
@@ -201,0 +201,0 @@ throw new Error(`Failure has been rejected because execution is not running (executionName='${executionName}')`) |
@@ -50,3 +50,3 @@ 'use strict' | ||
if (catchHandler) { | ||
this.runTaskNextState( | ||
return this.runTaskNextState( | ||
executionName, | ||
@@ -57,12 +57,12 @@ stateMachine, | ||
) | ||
} else { | ||
const tracker = this.parallelBranchTracker | ||
tracker.registerChildExecutionFail(executionName) | ||
const failedExecutionDescription = await this.dao.failExecution( | ||
executionDescription, | ||
options.cause, | ||
options.error | ||
) | ||
return failedExecutionDescription | ||
} // if (throwException) | ||
} | ||
const tracker = this.parallelBranchTracker | ||
tracker.registerChildExecutionFail(executionName) | ||
const failedExecutionDescription = await this.dao.failExecution( | ||
executionDescription, | ||
options.cause, | ||
options.error | ||
) | ||
return failedExecutionDescription | ||
} // runTaskFailure | ||
@@ -69,0 +69,0 @@ |
{ | ||
"name": "@wmfs/statebox", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Orchestrate Node functions using Amazon States Language", | ||
@@ -52,3 +52,3 @@ "author": "West Midlands Fire Service", | ||
"commitizen": { | ||
"path": "./node_modules/cz-conventional-changelog" | ||
"path": "cz-conventional-changelog" | ||
} | ||
@@ -55,0 +55,0 @@ }, |
@@ -94,3 +94,3 @@ /* eslint-env mocha */ | ||
it('sendTaskSuccess (i.e. some completed form data)', async () => { | ||
await statebox.sendTaskSuccess( | ||
const execDesc = await statebox.sendTaskSuccess( | ||
executionName, | ||
@@ -103,2 +103,4 @@ { | ||
) | ||
expect(execDesc.status).to.eql('RUNNING') | ||
}) | ||
@@ -149,3 +151,3 @@ | ||
it('sendTaskFailure', async () => { | ||
await statebox.sendTaskFailure( | ||
const execDesc = await statebox.sendTaskFailure( | ||
executionName, | ||
@@ -157,2 +159,4 @@ { | ||
) | ||
expect(execDesc.status).to.eql('FAILED') | ||
}) | ||
@@ -159,0 +163,0 @@ |
101327
2839