This is my Lambda code:
async function getDataFromDB(param) {
(0, lambda_utils_utility_1.utility_printf)(getDataFromDB, arguments);
const command = new lib_dynamodb_1.GetCommand(param);
try {
const result = await dynamo.send(command);
return result.Item;
}
catch (err) {
console.error(`An error has occurred on getDataFromDB.\nerror message => "${err?.message}"\narguments => `, arguments);
throw err;
}
}
When I run on parallel to get from same Table, sometime below error occurred
{
""level"": ""ERROR"",
""message"": ""--getDataFromDB"",
""service"": ""service_undefined"",
""timestamp"": ""2024-03-04T08:53:06.247Z"",
""xray_trace_id"": ""1-65e58bd6-55b0a6b3fa6e6d2e88640a00"",
""error"": {
""name"": ""ResourceNotFoundException"",
""location"": ""/var/runtime/node_modules/@aws-sdk/client-dynamodb/dist-cjs/protocols/Aws_json1_0.js:2879"",
""message"": ""Requested resource not found"",
""stack"": ""ResourceNotFoundException: Requested resource not found\n at de_ResourceNotFoundExceptionRes (/var/runtime/node_modules/@aws-sdk/client-dynamodb/dist-cjs/protocols/Aws_json1_0.js:2879:23)\n at de_GetItemCommandError (/var/runtime/node_modules/@aws-sdk/client-dynamodb/dist-cjs/protocols/Aws_json1_0.js:1552:25)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async /var/runtime/node_modules/@aws-sdk/node_modules/@smithy/middleware-serde/dist-cjs/deserializerMiddleware.js:7:24\n at async /var/runtime/node_modules/@aws-sdk/lib-dynamodb/dist-cjs/baseCommand/DynamoDBDocumentClientCommand.js:29:34\n at async /var/runtime/node_modules/@aws-sdk/middleware-signing/dist-cjs/awsAuthMiddleware.js:30:20\n at async /var/runtime/node_modules/@aws-sdk/node_modules/@smithy/middleware-retry/dist-cjs/retryMiddleware.js:27:46\n at async /var/runtime/node_modules/@aws-sdk/middleware-logger/dist-cjs/loggerMiddleware.js:7:26\n at async getDataFromDB (/opt/nodejs/node_modules/@mui/lambda-utils/dist/lib/dynamodb/lambda_utils.dynamodb.js:75:24)\n at async getSummaryInfo (/var/task/app.js:476:21)\n at async handleUpdateOnePaymentOfServNo (/var/task/app.js:75:33)\n at async handleUpdateDataByServNo (/var/task/app.js:61:9)\n at async Runtime.lambdaHandler [as handler] (/var/task/app.js:42:13)""
}
}
Please tell me how to fix