Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
Description
I have some weird issue with FlattenException. I tried to fix it myself but after few hours of thinking what can be wrong I didn't come to anything.
What I found out is that the FlattenException create method is called, with ClassNotFound exception as the first argument, with message that the FlattenException class is not found.
It sounds like a non-sense.
Actually I know what is wrong in my business logic code. I have a class that has incompatible method declaration with the parent class. I know it because I printed the exception stack in ExceptionHandler::createResponse. Then there is FlattenException::create method called which causes ClassNotFoundException, even it actually go into the create method.
The error message is
ClassNotFoundException: Attempted to load class "FlattenException" from namespace "Symfony\Component\Debug\Exception" in /var/www/grocery/src/Potato/LocationBundle/Adapter/LocationEntity.php line 0. Do you need to "use" it from another namespace? Perhaps you need to add a use statement for one of the following: Symfony\Component\HttpKernel\Exception\FlattenException, Symfony\Component\Debug\Exception\FlattenException.
LocationEntity.php on line 0?
It is not a true of course.
When I comment out the FlattenException::create line, then Symfony doesn't print anything.
I tried to find the reason and fix it myself but I gave up. It may be even a PHP bug.