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

fix: use the custom error message correctly #3728

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sunnylost
Copy link

fix #3675

Error messages provided by the user should have the highest priority, so if they exist, they can be used directly.

Copy link

netlify bot commented Aug 28, 2024

Deploy Preview for guileless-rolypoly-866f8a ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 4b94fbc
🔍 Latest deploy log https://app.netlify.com/sites/guileless-rolypoly-866f8a/deploys/66cf024412e6d50008e86d63
😎 Deploy Preview https://deploy-preview-3728--guileless-rolypoly-866f8a.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@StephanMeijer
Copy link

StephanMeijer commented Sep 4, 2024

What's the conceptual difference?

@sunnylost
Copy link
Author

Under this condition if (iss.code !== "invalid_type"), zod won't display user's custom message.

Copy link

@TadeoArtia TadeoArtia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great and much needed !

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

Successfully merging this pull request may close these issues.

z.union() ignores custom error message
3 participants