You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
The text was updated successfully, but these errors were encountered:
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
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?
.flatten()
from zod to group errors differentlyThe text was updated successfully, but these errors were encountered: