Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Make failed entity argument resolving display a usefull error message #60111

Closed
@nicolas-grekas

Description

@nicolas-grekas

Description

Current, using the default recipe coming with Symfony 7.2, when one has a controller like that:

    #[Route('/conference/{slug}', name: 'conference')]
    public function show(Conference $conference) {

One will get this message:

Image

When you know the solution, the fix is trivial:

-    #[Route('/conference/{slug}', name: 'conference')]
+    #[Route('/conference/{slug:conference}', name: 'conference')]

But when you don't, you're SOL.

The thing is, we do have the reporting infrastructure to improve this: NearMissValueResolverException as introduced in #54107.
It'd be great to leverage it for similar cases.

Help wanted.

Example

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Help wantedIssues and PRs which are looking for volunteers to complete them.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions