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

Collect all validation errors and then fail #126

Open
todvora opened this issue Mar 6, 2024 · 2 comments · May be fixed by #127
Open

Collect all validation errors and then fail #126

todvora opened this issue Mar 6, 2024 · 2 comments · May be fixed by #127
Assignees
Labels

Comments

@todvora
Copy link
Contributor

todvora commented Mar 6, 2024

Current implementation stops with the first validation/parameter exception. If users have several problems in the configuration, they need to fix one by one and always restart the graylog server meanwhile. If we could collect all errors and only then fail, it would simplify initial setups significantly.

Maybe it would be enough to adapt https://github.com/Graylog2/JadConfig/blob/main/src/main/java/com/github/joschi/jadconfig/JadConfig.java#L91 , instead of throwing exceptions collect them and then fail if there is at least one, throwing one wrapping all failures.

@bernd
Copy link
Member

bernd commented Mar 6, 2024

@todvora We could introduce an additional parse method that behaves like that. Changing the behavior of the existing #process method would be a breaking change.

@luk-kaminski luk-kaminski self-assigned this Mar 27, 2024
@luk-kaminski luk-kaminski linked a pull request Mar 27, 2024 that will close this issue
2 tasks
@todvora
Copy link
Contributor Author

todvora commented Apr 25, 2024

Implemented in #127. Here it would need only a very tiny change, switching from jadConfig.process() to jadConfig.processFailingLazily()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants