Skip to content

FlattenException class not found. #10313

@filipgorny

Description

@filipgorny

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions