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

Implement custom error messages when using a custom validator for an argument #17

Closed
gcramarossa opened this issue Dec 11, 2023 · 0 comments · Fixed by #18
Closed

Implement custom error messages when using a custom validator for an argument #17

gcramarossa opened this issue Dec 11, 2023 · 0 comments · Fixed by #18
Labels
area-core The issue refers to the core library enhancement New feature or request
Milestone

Comments

@gcramarossa
Copy link
Contributor

ISSUE TYPE

Feature

SHORT DESCRIPTION

Custom validator returns a generic message when a value is not valid hat is not very helpful

DESCRIPTION

Since version 0.2.0, there is the possibility to validate arguments value inserted by the user. In order to do it, there is a new attribute called ValueValidator and a new interface called IValueValidator.
If a value passed to an argument is not valid, the application returns an error like the one below

[10/12/2023 20:53:21] ERROR (3) : The value provided to argument score is not valid according to the validation procedure

Hovewer, this error message is generic and may not be helpful to understand what are the correct values.

It is needed to provide a way to give custom error message so that the error is more specific and help the user to choose the correct value for the argument.

ACCEPTANCE CRITERIA

The library should raise an error with the custom message if the value chosen by the user is not valid

@gcramarossa gcramarossa added enhancement New feature or request area-core The issue refers to the core library labels Dec 11, 2023
@gcramarossa gcramarossa added this to the 0.3.0 milestone Dec 11, 2023
@gcramarossa gcramarossa changed the title Implement custom error message when using a custom validator for an argument Implement custom error messages when using a custom validator for an argument Dec 11, 2023
gcramarossa added a commit that referenced this issue Dec 12, 2023
…essage-validator

Feature #17 custom error message in custom argument validation added
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core The issue refers to the core library enhancement New feature or request
Projects
None yet
1 participant