Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[DI] Throw useful error msg when trying to access not-found but private service #24444

Copy link
Copy link
Closed
@nicolas-grekas

Description

@nicolas-grekas
Issue body actions
Q A
Bug report? no
Feature request? no
BC Break report? no
RFC? yes
Symfony version 3.4

Right now, when a service is not found, we throw a ServiceNotFoundException with some suggestions.
But when the lookup is for a private service that ended up being removed or inlined, that message is not accurate: we should instead hint about the service being private + suggest to either turn it public or not use the container at all (similar to the deprecation in Container::get()).

On 4.0, where services will be private by default, this looks like a DX requirement to me, so we should do it during the feat. freeze.

Metadata

Metadata

Labels

DependencyInjectionRFCRFC = Request For Comments (proposals about features that you want to be discussed)RFC = Request For Comments (proposals about features that you want to be discussed)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.