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

Make validation errors less verbose #1921

Open
hannobraun opened this issue Jul 10, 2023 · 0 comments
Open

Make validation errors less verbose #1921

hannobraun opened this issue Jul 10, 2023 · 0 comments
Labels
topic: validation Infrastructure for checking various properties of objects, making sure they are valid. type: feature New features and improvements to existing features

Comments

@hannobraun
Copy link
Owner

Validation errors tend to be very verbose. The information they provide is often required to figure out what went wrong in the first place, so we can't outright remove that information from the error message. But it would be nice, if they were less verbose by default, and there was a flag in the standard model CLI to switch on full verbosity. I've looked into this and, unfortunately, didn't find a good solution.

Formatting can be controlled from the outside by enabling an "alternate" mode ({:#} instead of {}) and it's straight-forward to change formatting based on that. However, we don't fully control validation error formatting. It's possible that the validation errors end up being returned from a main function (which happens with the default setup), and then formatting is controlled by Rust's error handling machinery, Anyhow,, and/or thiserror, and I don't know how to enable the alternate mode then.

Another idea I have, is to add a flag to the validation error types themselves, which would allow us to control verbosity when they're created. This sounds practical, but requires changes to all error types, plus some generic infrastructure to prevent duplication.

@hannobraun hannobraun added type: feature New features and improvements to existing features topic: core Issues relating to core geometry, operations, algorithms labels Jul 10, 2023
@hannobraun hannobraun added topic: validation Infrastructure for checking various properties of objects, making sure they are valid. and removed topic: core Issues relating to core geometry, operations, algorithms labels Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: validation Infrastructure for checking various properties of objects, making sure they are valid. type: feature New features and improvements to existing features
Projects
None yet
Development

No branches or pull requests

1 participant