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

3.1.11 - Validation broken in custom providers #5585

Closed
kissifrot opened this issue May 9, 2023 · 2 comments
Closed

3.1.11 - Validation broken in custom providers #5585

kissifrot opened this issue May 9, 2023 · 2 comments

Comments

@kissifrot
Copy link

kissifrot commented May 9, 2023

API Platform version(s) affected: 3.1.11

Description
#5583 added a very broad catch in ReadListener, which will now make all errors happening in providers as 404 ones.

How to reproduce

  • Create a custom implementation of ProviderInterface and assign it to a resource's Get(Collection) operation
  • Make it throw a \ApiPlatform\Validator\Exception\ValidationException
  • Check for error code, should be a 422 but is now a 404

Possible Solution
I'm not sure whether RuntimeException should be caught, but a more specific exception class I guess

Additional Context

@kissifrot kissifrot changed the title 3.1.11 - Validation broken in providers 3.1.11 - Validation broken in custom providers May 9, 2023
soyuka added a commit to soyuka/core that referenced this issue May 10, 2023
@soyuka
Copy link
Member

soyuka commented May 10, 2023

good catch, does my fix work for you ?

@kissifrot
Copy link
Author

good catch, does my fix work for you ?

Yes it does, thanks! 👍

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

No branches or pull requests

2 participants