You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tested only on v4, but looking at the code it seems to be also present in v5.
What did you expect to happen?
When a ValidationException is thrown from a route, I would expect the request to be redirected to the previous page with an error bag or in the case of a JSON endpoint returning validation errors.
This behavior has been implemented in the Illuminate exception handler's convertValidationExceptionToResponse method. But Acorn's exception handler's render method overrides the base class' render method, which results in convertValidationExceptionToResponse never being called for ValidationExceptions.
Is there some reason for this simplified render method being used, instead of the full implementation which removes support for proper ValidationException handling? This could be fixed by either adding support for ValidationException to the render method override or otherwise maybe even just using the base method, if it doesn't cause any issues. Thoughts?
What actually happens?
ValidationExceptions are treated like any other exception and results in the generic error view being rendered.
Steps to reproduce
Throw ValidationException in a route
See that the exception does not result in a redirect or correct json response.
System info
No response
Log output
No response
Please confirm this isn't a support request.
Yes
The text was updated successfully, but these errors were encountered:
Ok cool, thanks for the quick response!
Do you think it should be doable just to use the base render method or do some obvious issues come to mind with that?
Will of course test it either way, but just in case you have any thoughts :)
I'll be happy to do a PR, will take a look at it in the coming days 👍
Version
Tested only on v4, but looking at the code it seems to be also present in v5.
What did you expect to happen?
When a ValidationException is thrown from a route, I would expect the request to be redirected to the previous page with an error bag or in the case of a JSON endpoint returning validation errors.
This behavior has been implemented in the Illuminate exception handler's convertValidationExceptionToResponse method. But Acorn's exception handler's render method overrides the base class' render method, which results in convertValidationExceptionToResponse never being called for ValidationExceptions.
Is there some reason for this simplified render method being used, instead of the full implementation which removes support for proper ValidationException handling? This could be fixed by either adding support for ValidationException to the render method override or otherwise maybe even just using the base method, if it doesn't cause any issues. Thoughts?
What actually happens?
ValidationExceptions are treated like any other exception and results in the generic error view being rendered.
Steps to reproduce
System info
No response
Log output
No response
Please confirm this isn't a support request.
Yes
The text was updated successfully, but these errors were encountered: