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

Support error custom message #1064

Open
thoriqadillah opened this issue Oct 11, 2024 · 0 comments
Open

Support error custom message #1064

thoriqadillah opened this issue Oct 11, 2024 · 0 comments

Comments

@thoriqadillah
Copy link

thoriqadillah commented Oct 11, 2024

I'm using nestia ^3.2.1, and the current error message is a bit too verbose. I'm aware that you can't add error message because the possibilities is infinite as stated in #886

but, what if you introduce new tag instead for the custom error message such as

interface Foo {
  bar: string & tags.Message<"Bar is required">
}

or

interface Foo {
  bar: number & tags.Max<3, "Maximum number is 3">
}

so there is no need to check the possibilities. if the message is defined, always fallback to the custom one

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