We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello there,
during the hands-on work in today's workshop I came across a question regarding the possibility to change the error messages of the decorators.
Why?
try catch
Imagine following scenario @attr(number({min: 0, max: 5}), {reflective: false}) accessor value = 0;
@attr(number({min: 0, max: 5}), {reflective: false}) accessor value = 0;
Whenever value becomes > 5 it produces always the same exception:
RangeError: 6 is out of range [0, 5]
That's fine, but... it would be much better to have a way to set your own messages and/or to be able to treat them individually.
Example:
Number can't be higher than 5 Number can't be lower than 0
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello there,
during the hands-on work in today's workshop I came across a question regarding the possibility to change the error messages of the decorators.
Why?
try catch
)Imagine following scenario
@attr(number({min: 0, max: 5}), {reflective: false}) accessor value = 0;
Whenever value becomes > 5 it produces always the same exception:
That's fine, but... it would be much better to have a way to set your own messages and/or to be able to treat them individually.
Example:
The text was updated successfully, but these errors were encountered: