Skip to content

Support custom errors #54

@BTOdell

Description

@BTOdell

https://zod.dev/error-customization?id=the-error-param

This library currently hardcodes the error string if parsing/coercion fails. Unfortunately, it would be a breaking change to make the z* validators functions instead of objects:

zPlainDate("error message")

or:

zPlainDate({ message: "error message" })

Maybe they could be both validator objects and a function that returns validator objects?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions