Skip to content
This repository was archived by the owner on Jun 22, 2021. It is now read-only.

Commit 4024061

Browse files
committed
docs(readme): Adds notes about default implementations for handleTransaction.
1 parent 928e7dd commit 4024061

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

readme.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,14 @@ const todosFacade = factory<TodoEntity>({
3333
},
3434
// Optional property.
3535
defaultPaginationLimit: 10,
36-
// Optional property to handle transactions.
36+
// Optional property to handle transactions. Defaults to "utils/handleTransaction".
3737
handleTransaction: async ({ req, res }, handler) => {
3838
// The transactionId allow items found in logs to be matched with responses to users.
3939
const transactionId = uuid();
4040
try {
4141
await handler({ transactionId });
4242
} catch (err) {
43+
// The default handleTransaction uses "utils/handleError" here.
4344
console.error({ err, req, res, transactionId})
4445
res.status(500).send(transactionId);
4546
}

0 commit comments

Comments
 (0)