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

Improve error messages on user data #990

Open
MikeNeilson opened this issue Dec 20, 2024 · 0 comments
Open

Improve error messages on user data #990

MikeNeilson opened this issue Dec 20, 2024 · 0 comments

Comments

@MikeNeilson
Copy link
Contributor

So we currently have better support for validating user data, with the validation call on the CwmsDto.

However, it's clearly not quite enough. See #988.

Unfortunately I don't think the error messaging from the database will allow an automated "the public name is too long" error, I was able to track it down to a line that assigns a value to the public name, but the code doesn't see that.

Thus we need a better way for the in-cda validation system to report direct information like this to the user.

Given that https://github.com/USACE/cwms-data-api/blob/develop/cwms-data-api/src/main/java/cwms/cda/data/dto/CwmsDTOValidator.java#L54 already uses reflection to retrieve information, would it make sense to expand that system to also pull information, perhaps configured though additional annotations on the DTOs, from either the database or JOOQ.

This would allow us to relate a given field to a specific column in the code so that things like "size limits" can be more distinctly reported to the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

1 participant