Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: makeHandlerIdempotent Masks Internal Errors #1530

Closed
1 of 2 tasks
brianhyder opened this issue Jun 21, 2023 · 3 comments · Fixed by #1552
Closed
1 of 2 tasks

Feature request: makeHandlerIdempotent Masks Internal Errors #1530

brianhyder opened this issue Jun 21, 2023 · 3 comments · Fixed by #1552
Assignees
Labels
completed This item is complete and has been merged/shipped feature-request This item refers to a feature request for an existing or new utility idempotency This item relates to the Idempotency Utility

Comments

@brianhyder
Copy link

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.

@brianhyder brianhyder added triage This item has not been triaged by a maintainer, please wait feature-request This item refers to a feature request for an existing or new utility labels Jun 21, 2023
@dreamorosi dreamorosi added idempotency This item relates to the Idempotency Utility confirmed The scope is clear, ready for implementation and removed triage This item has not been triaged by a maintainer, please wait labels Jun 21, 2023
@dreamorosi
Copy link
Contributor

Hi @brianhyder, thanks for opening the issue and presenting suggestions.

The use case is valid and we shouldn't be catching & masking the errors generated from your code.

We'll be discussing this later today & propose a solution in an upcoming PR.

@brianhyder
Copy link
Author

Thank you!

@github-actions
Copy link
Contributor

⚠️ COMMENT VISIBILITY WARNING ⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@github-actions github-actions bot added pending-release This item has been merged and will be released soon and removed confirmed The scope is clear, ready for implementation labels Jun 26, 2023
@dreamorosi dreamorosi added completed This item is complete and has been merged/shipped and removed pending-release This item has been merged and will be released soon labels Jun 26, 2023
@dreamorosi dreamorosi moved this from Coming soon to Shipped in Powertools for AWS Lambda (TypeScript) Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completed This item is complete and has been merged/shipped feature-request This item refers to a feature request for an existing or new utility idempotency This item relates to the Idempotency Utility
Projects
Development

Successfully merging a pull request may close this issue.

3 participants