Skip to content

Bug: IdempotencyPersistenceLayerError cause undefined #2915

Closed
@jorgecamilowu

Description

@jorgecamilowu

Expected Behavior

When looking at the logs, the cause attribute of IdempotencyPersistenceLayerError should include what actually went wrong.

Discord discussion link

Current Behavior

The cause attribute of IdempotencyPersistenceLayerError is undefined

Code snippet

const persistenceStore = new DynamoDBPersistenceLayer({
  tableName: "Token.1234",
});

export const handler = makeIdempotent(handlerFunction, {
  persistenceStore,
});

Steps to Reproduce

  1. Pass an invalid table name to DynamoDBPersistenceLayer such as "Token.1234"
  2. Trigger the lambda
  3. See IdempotencyPersistenceLayerError error in Cloudwatch logs missing the cause attribute
    image

Possible Solution

No response

Powertools for AWS Lambda (TypeScript) version

2.7.0

AWS Lambda function runtime

20.x

Packaging format used

npm

Execution logs

2024-08-12T06:04:28.165Z	1ecc73f4-1b73-4bf0-bf92-d8fd26a123d6	ERROR	Invoke Error 	{
    "errorType": "IdempotencyPersistenceLayerError",
    "errorMessage": "Failed to save in progress record to idempotency store",
    "name": "IdempotencyPersistenceLayerError",
    "stack": [
        "IdempotencyPersistenceLayerError: Failed to save in progress record to idempotency store",
        "    at #saveInProgressOrReturnExistingResult (/var/task/index.js:1459894:13)",
        "    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)",
        "    at async IdempotencyHandler.handle (/var/task/index.js:1459814:42)"
    ]
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcompletedThis item is complete and has been merged/shippedidempotencyThis item relates to the Idempotency Utility

Type

No type

Projects

Status

Shipped

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions