Skip to content

Feature request: makeHandlerIdempotent Masks Internal Errors #1530

Closed
@brianhyder

Description

@brianhyder

Use case

As an engineer implementing the idempotency package, I need to know what is causing the failures while testing the implementation. I must be able to see, in output or attached to the error that is surfaced, to properly handle or mitigate the error. It took additional time to line-by-line debug it.

Example: While testing, I had forgotten to give my lambda permissions to the dynamodb table. The test failed with a generic error with message, Failed to save in progress record to idempotency store.

Example: While testing, my sso session had expired and my credentials were no longer valid. My tests failed with a generic error with a message such as, Failed to update success record to idempotency store.

Place where this happens:

Solution/User Experience

Consider one or both of the following:

  1. Log the error out to standard error
  2. Attach the original error as an inner error.
const persistenceErr = new IdempotencyPersistenceLayerError(
  'Failed to save in progress record to idempotency store'
);
persistenceErr.inner = originalErr;

Alternatively, you just make each of the custom errors take an additional argument which is the original error.

Alternative solutions

see above

Acknowledgment

Future readers

Please react with 👍 and your use case to help us understand customer demand.

Metadata

Metadata

Assignees

Labels

completedThis item is complete and has been merged/shippedfeature-requestThis item refers to a feature request for an existing or new utilityidempotencyThis item relates to the Idempotency Utility

Type

No type

Projects

Status

Shipped

Relationships

None yet

Development

No branches or pull requests

Issue actions