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

Improve error formatting for validating metadata in commerce-kit #17

Open
3 tasks
typeofweb opened this issue Aug 10, 2024 · 0 comments
Open
3 tasks

Improve error formatting for validating metadata in commerce-kit #17

typeofweb opened this issue Aug 10, 2024 · 0 comments
Assignees

Comments

@typeofweb
Copy link
Member

typeofweb commented Aug 10, 2024

Currently, metadata for different entities is validated in runtime. In case there are any issues, a Zod error is thrown.

Zod errors are useful but not instantly readable to our users. This should be improved. Moreover, sometimes context information is lacking – i.e., which product validation did fail?

  • keep as much information in errors as possible
  • consider using .flatten() from zod to group errors differently
  • consider throwing a custom error with all the information from Zod + more context (i.e., entity ID)
@typeofweb typeofweb self-assigned this Aug 10, 2024
@typeofweb typeofweb changed the title Improve error handling for validating metadata in commerce-kit Improve error formatting for validating metadata in commerce-kit Aug 10, 2024
@typeofweb typeofweb mentioned this issue Aug 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant