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

Implement nicer stacktrace #31

Open
MikolajKakol opened this issue Feb 10, 2020 · 1 comment
Open

Implement nicer stacktrace #31

MikolajKakol opened this issue Feb 10, 2020 · 1 comment

Comments

@MikolajKakol
Copy link

MikolajKakol commented Feb 10, 2020

Is your feature request related to a problem? Please describe.

I often write few happy path examples for validation. However, if we hit an error when running them stacktrace is not helpful. We get

org.valiktor.ConstraintViolationException
	at org.valiktor.ValidatorKt.validate(Validator.kt:38)

It would be good to know what happened by just looking into stracktrace

Describe the solution you'd like

Maybe implementing toString in ConstraintViolationException would suffice.

Alternative solution

Maybe adding shouldPassValidation method to test framework would be even better?

@rodolphocouto
Copy link
Member

Hey @MikolajKakol, sorry for my delay. Yeah, it makes sense, I think we can define an exception message including the constraint violations to make debugging easier. I'd would like to receive a PR adjusting it, feel free to contribute.

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

No branches or pull requests

2 participants