-
Notifications
You must be signed in to change notification settings - Fork 700
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
Exceptions mapped in config aren't caught anymore, 500 is thrown instead #2369
Comments
Hi! I have also been facing this issue, trying to clean up the log output to focus on what matter and having uncaught exception is making it harder. |
@SebastienTediber I think your configuration needs an update. Mine is working fine, here it is (the exception part): fos_rest:
exception:
map_exception_codes: true
codes:
'InvalidArgumentException': 422
'Doctrine\ORM\EntityNotFoundException': 404
messages:
'InvalidArgumentException': true
'Doctrine\ORM\EntityNotFoundException': true You also have to set exception_controller to null in twig.yaml, if you're using twig |
Hello @InjustFr, We investigated the issue further and came upon a Twig issue too indeed, that we fixed differently. I will look into what you propose though because it looks better than our solution. Thanks |
Hello again @InjustFr , We tried your solution and it works fine for us. Thanks again |
Hello,
Since we updated to 3.x.x, the exceptions I mapped in my config files aren't caught and a 500 is thrown instead.
Here is my configuration :
I have been trying with InvalidArgumentException thrown.
I have been changing the configuration a few times, adding the code to my exception too, it still does not work.
The text was updated successfully, but these errors were encountered: