Skip to content

Commit 3d8e037

Browse files
committed
feature #30569 [FrameworkBundle][HttpKernel] Provide intuitive error message when a controller fails because it's not registered as a service (moynzzz)
This PR was squashed before being merged into the 4.3-dev branch (closes #30569). Discussion ---------- [FrameworkBundle][HttpKernel] Provide intuitive error message when a controller fails because it's not registered as a service | Q | A | ------------- | --- | Branch? | master <!-- see below --> | Bug fix? | no | New feature? | yes <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #27787, symfony/symfony-docs#7988 <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | none <!-- required for new features --> <!-- Write a short README entry for your feature/bugfix here (replace this comment block.) This will help people understand your PR and can be used as a start of the Doc PR. Additionally: - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. --> Create a very late controller argument value resolver to throw an intuitive error message when controller fails because it is not registered as a service. Commits ------- fbfc623b72 [FrameworkBundle][HttpKernel] Provide intuitive error message when a controller fails because it's not registered as a service
2 parents ffc4adc + 145ed1e commit 3d8e037

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Resources/config/debug.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,10 @@
2323
<argument type="service" id="debug.argument_resolver.inner" />
2424
<argument type="service" id="debug.stopwatch" />
2525
</service>
26+
27+
<service id="argument_resolver.not_tagged_controller" class="Symfony\Component\HttpKernel\Controller\ArgumentResolver\NotTaggedControllerValueResolver">
28+
<tag name="controller.argument_value_resolver" priority="-200" />
29+
<argument />
30+
</service>
2631
</services>
2732
</container>

0 commit comments

Comments
 (0)