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

[BUG] Kind of exception thrown on validation error #521

Open
kennaar opened this issue Apr 15, 2019 · 1 comment
Open

[BUG] Kind of exception thrown on validation error #521

kennaar opened this issue Apr 15, 2019 · 1 comment
Labels

Comments

@kennaar
Copy link

kennaar commented Apr 15, 2019

Why does this package throw a Illuminate\Http\Exceptions\HttpResponseException when form validation fails? Laravel form request classes throw a Illuminate\Validation\ValidationException.
Wouldn't it be better to throw that one instead to stay inline with the "defaul" laravel way?

@rudiedirkx
Copy link
Collaborator

That's a good point. And it takes a response, which we need, and it's handled well.

It's not a bug, but definitely an improvement. You want to make a PR? If so, don't forget about the tests: it_can_automatically_redirect_back_when_failing_verification and it_can_automatically_redirect_to_a_specified_destination_when_failing_verification.

Just be sure that all recent Laravel versions still work, since Laravel introduces breaking changes in minor releases. If ValidationException only exists since 5.7 (I've no idea), we need a HttpResponseException fallback.

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

No branches or pull requests

2 participants