Skip to content

Improve error message when a service is missing and ServiceSubscriberInterface/a ServiceLocator is used #25196

Closed
@nicolas-grekas

Description

@nicolas-grekas
Q A
Bug report? DX one
Feature request? no
BC Break report? no
RFC? yes
Symfony version 3.4/3.3

As seen in #25194, it can be hard for newcomers to know why $this->get(Some::class) doesn't work.
In a "failure driven development" spirit, we should improve the message, so that ppl can resolve that on their own.

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions