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

Fixed #26. (Report on multiple validation errors) #24

Merged
merged 1 commit into from
Sep 25, 2017

Conversation

rosslamont
Copy link
Contributor

@rosslamont rosslamont commented Aug 28, 2017

Motivation: Improve usability by detecting multiple validation errors in one pass

Solution: Use a custom ErrorHandler to collect all errors and report them after validation. Existing error formatting code has been moved untouched to a new method.

When using Validator.validate, most validation errors will be ignored. The only
reliable way to capture validation errors is to use an error handler, as
Validator.validate only throws fatal errors (validation errors are not fatal -
see javadoc for ErrorHandler)

Solution applied refactors existing error handling approach to always use an
ErrorHandler to capture errors. As a bonus, you should get log messages showing
multiple failures, rather than just the first.
@rosslamont rosslamont changed the title Fixed #20. Fixed #20. (Validator.validate unreliable without an ErrorHandler) Sep 20, 2017
@rosslamont rosslamont changed the title Fixed #20. (Validator.validate unreliable without an ErrorHandler) Fixed #26. (Report on multiple validation errors) Sep 20, 2017
@rosslamont
Copy link
Contributor Author

Originally this fix was for Issue #20, but I later realised #20 was erroneous. This solution though is still valuable as it does streamline a developers debugging work.

@jochenw jochenw merged commit 56478fd into mojohaus:master Sep 25, 2017
jochenw added a commit that referenced this pull request Sep 25, 2017
@rosslamont rosslamont deleted the issue-20 branch October 3, 2017 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants