aws-powertools / powertools-lambda-typescript

Powertools is a developer toolkit to implement Serverless best practices and increase developer velocity.
https://docs.powertools.aws.dev/lambda/typescript/latest/
MIT No Attribution
1.58k stars 139 forks source link

Feature request: add custom Error for envelopes #1822

Open am29d opened 10 months ago

am29d commented 10 months ago

Use case

When parsing custom schema in the envelope we currently propagate any error from zod back to the user. When there is an error, the mental process is first to localise it between envelope or custom schema. We should provide a custom Error that clearly points out which part of the structure is invalid. This will allow to faster resolution of the error.

Solution/User Experience

No solution yet.

Alternative solutions

No response

Acknowledgment

Future readers

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

dreamorosi commented 3 months ago

Revisiting this after a few months since the last interaction.

So far, most likely due to the utility being in beta, there hasn't been much demand for this.

We'll check back in a few months to see if things have changed, in the meanwhile Zod might have launched its next major version which is expected to include changes to the errors API.