Skip to content

Commit 3cbcfda

Browse files
committed
📝 docs: Add an informative log
when return statement is missing or invalid in transformUp function
1 parent 8e16a1d commit 3cbcfda

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dynamo-data-transform",
3-
"version": "0.1.9",
3+
"version": "0.1.10",
44
"description": "DynamoDB Data Transformation Tool",
55
"main": "./index.js",
66
"repository": "https://github.com/jitsecurity/dynamo-data-transform",

src/command-handlers/up.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@ const executeDataTransformation = async (ddb, transformation, table, isDryRun) =
2222

2323
const transformationResponse = await transformUp({ ddb, preparationData, isDryRun });
2424
if (!isDryRun) {
25-
await syncTransformationRecord(ddb, transformationNumber, table, transformationResponse?.transformed);
25+
if (transformationResponse) {
26+
await syncTransformationRecord(ddb, transformationNumber, table, transformationResponse?.transformed);
27+
} else {
28+
console.error(`"return" statement is missing or invalid in your transformUp function.
29+
Please provide a transformation response "return { transformed: <number> }".
30+
See documentation for more details.`);
31+
}
2632
} else {
2733
console.info("It's a dry run");
2834
}

0 commit comments

Comments
 (0)