Skip to content

[Config] Wrong exception thrown #14111

Closed
Closed
@twifty

Description

@twifty

I have a custom route loader. When an exception is thrown from within my loader, in this case it's a ContextErrorException for an invalid array key, the browser always shows a CircularReferenceException.

Digging into the Symfony code, I can see the problem.

On line 104 of the Component\Config\Loader\FileLoader class, the resource is added as a key to a static array. When an exception is thrown within the custom loader (line 106), that key is never cleared. Then, the WebDebugToolbar tries generating it's own routes. Because that static array still contains valid data, the first resource routing_dev.yml causes the circular reference to be thrown.

I think the key should also be unset within the catch block.

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