Description
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:
- Log the error out to standard error
- 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
- This feature request meets Powertools for AWS Lambda (TypeScript) Tenets
- Should this be considered in other Powertools for AWS Lambda languages? i.e. Python, Java, and .NET
Future readers
Please react with 👍 and your use case to help us understand customer demand.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status