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

Show violation details in case a ConstraintViolationException is raised #434

Merged

Conversation

schabdo
Copy link
Member

@schabdo schabdo commented Feb 10, 2017

We show now the details of a constraint violation in the UI

screen shot 2017-02-10 at 16 32 13

Reviewer: @melanieretter and @kaizimmerm

Signed-off-by: Dominic Schabel <dominic.schabel@bosch-si.com>

String errorMessage = ex.getClass().getSimpleName();

if (ConstraintViolationException.class.isAssignableFrom(ex.getClass())) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would prefer early return

.getConstraintViolations();

if (violations != null) {
errorMessage = violations.stream().map(v -> v.getPropertyPath() + " " + v.getMessage())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v is not a meaningful name

@kaizimmerm kaizimmerm merged commit bc5b11d into eclipse:master Feb 14, 2017
@kaizimmerm kaizimmerm deleted the feature_show_details_of_constraint_error branch February 14, 2017 19:20
@kaizimmerm kaizimmerm modified the milestone: 0.2.0M3 Apr 3, 2017
AmmarBikic pushed a commit to bosch-io/hawkbit that referenced this pull request Oct 2, 2020
…ed (eclipse#434)

* Show violation details in case a ConstraintViolationException is raised

Signed-off-by: Dominic Schabel <dominic.schabel@bosch-si.com>

* Review comments added.
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

3 participants