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

Handling value parsing exceptions in validation #5317

Open
vursen opened this issue Aug 2, 2023 · 0 comments
Open

Handling value parsing exceptions in validation #5317

vursen opened this issue Aug 2, 2023 · 0 comments
Labels
a11y Accessibility issue enhancement New feature or request validation

Comments

@vursen
Copy link
Contributor

vursen commented Aug 2, 2023

Describe your motivation

The field components currently set their value to null when the user tries to commit non-parsable input. This causes their validation to fail with the bad input error.

However, there are components where certain user input can be parsed on the client-side but still get rejected by the server due to technical limitations. An example of this is IntegerField, where the user can enter a number that falls within the JavaScript integer limit but exceeds the Java integer limit.

Since such values appear valid to the user, it would make sense to treat them separately from completely nonsensical input (bad input) to allow providing an individual helpful error message instead of an unclear "invalid input".

Describe the solution you'd like

Add a step to the validation that would check if a value parsing exception has been thrown since the last value change. When this is the case, the validation returns an individual error message.

Additional context

Depends on:

Original requests:

@vursen vursen added enhancement New feature or request validation labels Aug 2, 2023
@rolfsmeds rolfsmeds added the a11y Accessibility issue label Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a11y Accessibility issue enhancement New feature or request validation
Projects
None yet
Development

No branches or pull requests

2 participants