Skip to content

[RFC] Exceptions that suggest your missing package #25256

Closed
@weaverryan

Description

@weaverryan
Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? yes
Symfony version 4.1.0

The negative of Flex is that if you try to use a feature that's not installed, you'll get an error. Recently, we updated the exception messages in ControllerTrait to suggest the package that the user is missing when necessary.

But there are so many other cases. For example, if you use {{ asset() }} in Twig without the Asset component:

screen shot 2017-12-01 at 1 28 32 pm

Idea: Add new dev-only behavior that somehow enhances this error page to add a:

To fix this, run "composer require asset"

We would maintain a list of error patterns/strings and what package is needed somewhere. This could even be stored in Flex itself, so that it could be updated easily and more often.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DXDX = Developer eXperience (anything that improves the experience of using Symfony)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions