Skip to content

Commit 6e25d7f

Browse files
author
Connor McMahon
committed
Merge branch 'dev'
2 parents 21406ee + 1cd822e commit 6e25d7f

21 files changed

+1496
-493
lines changed

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"typescript.tsdk": "node_modules\\typescript\\lib"
3+
}

package-lock.json

+16-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
{
22
"name": "durable-functions",
3-
"version": "1.3.2",
3+
"version": "1.3.3",
44
"description": "Durable Functions library for Node.js Azure Functions",
55
"license": "MIT",
6-
"repository": "github:Azure/azure-functions-durable-js",
6+
"repository": {
7+
"type": "git",
8+
"url": "git+https://github.com/Azure/azure-functions-durable-js.git"
9+
},
710
"author": "Microsoft Corporation",
811
"keywords": [
912
"azure-functions"
@@ -39,6 +42,7 @@
3942
},
4043
"devDependencies": {
4144
"@types/chai": "~4.1.6",
45+
"@types/chai-string": "~1.4.1",
4246
"@types/chai-as-promised": "~7.1.0",
4347
"@types/commander": "~2.3.31",
4448
"@types/debug": "0.0.29",
@@ -48,6 +52,7 @@
4852
"@types/rimraf": "0.0.28",
4953
"@types/sinon": "~5.0.5",
5054
"chai": "~4.2.0",
55+
"chai-string": "~1.5.0",
5156
"chai-as-promised": "~7.1.1",
5257
"mocha": "~5.2.0",
5358
"moment": "~2.22.2",
@@ -59,5 +64,13 @@
5964
},
6065
"engines": {
6166
"node": ">=6.5.0"
67+
},
68+
"bugs": {
69+
"url": "https://github.com/Azure/azure-functions-durable-js/issues"
70+
},
71+
"homepage": "https://github.com/Azure/azure-functions-durable-js#readme",
72+
"directories": {
73+
"lib": "lib",
74+
"test": "test"
6275
}
6376
}

src/aggregatederror.ts

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
const separator = "-----------------------------------";
2+
3+
/**
4+
* A specfic error thrown when context.df.Task.all() fails. Its message
5+
* contains an aggregation of all the exceptions that failed. It should follow the
6+
* below format:
7+
*
8+
* context.df.Task.all() encountered the below error messages:
9+
*
10+
* Name: DurableError
11+
* Message: The activity function "ActivityA" failed.
12+
* StackTrace: <stacktrace>
13+
* -----------------------------------
14+
* Name: DurableError
15+
* Message: The activity function "ActivityB" failed.
16+
* StackTrace: <stacktrace>
17+
*/
18+
export class AggregatedError extends Error {
19+
public errors: Error[];
20+
21+
constructor(errors: Error[]) {
22+
const errorStrings = errors.map((error, num) => `Name: ${error.name}\nMessage: ${error.message}\nStackTrace: ${error.stack}`);
23+
const message = `context.df.Task.all() encountered the below error messages:\n\n${errorStrings.join(`\n${separator}\n`)}`;
24+
super(message);
25+
this.errors = errors;
26+
}
27+
}

src/durableerror.ts

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* A specfic error thrown when a scheduled activity or suborchestrator has failed.
3+
* This error can be checked for via `instanceof` guards to catch only exceptions thrown
4+
* by the DurableJS library.
5+
*/
6+
export class DurableError extends Error {
7+
constructor(message: string | undefined) {
8+
super(message);
9+
}
10+
}

0 commit comments

Comments
 (0)