Skip to content

Commit 98c54b7

Browse files
committed
Add try/catch to JS sample
1 parent cf1ce30 commit 98c54b7

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

articles/azure-functions/durable/durable-functions-overview.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,14 @@ You can use the `context` parameter to invoke other functions by name, pass para
7575
const df = require("durable-functions");
7676

7777
module.exports = df.orchestrator(function*(context) {
78-
const x = yield context.df.callActivity("F1");
79-
const y = yield context.df.callActivity("F2", x);
80-
const z = yield context.df.callActivity("F3", y);
81-
return yield context.df.callActivity("F4", z);
78+
try {
79+
const x = yield context.df.callActivity("F1");
80+
const y = yield context.df.callActivity("F2", x);
81+
const z = yield context.df.callActivity("F3", y);
82+
return yield context.df.callActivity("F4", z);
83+
} catch (error) {
84+
// Error handling or compensation goes here.
85+
}
8286
});
8387
```
8488

0 commit comments

Comments
 (0)