Skip to content
Permalink
Browse files

feature #34312 [ErrorHandler] merge and remove the ErrorRenderer comp…

…onent (nicolas-grekas, yceruto)

This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] merge and remove the ErrorRenderer component

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | yes
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

This PR supersedes #34288.

Here is what it does:
- Merge the `ErrorRenderer` component into `ErrorHandler`
- Add `ErrorRendererInterface::render(\Throwable $e): FlattenException` and refactor error renderers around it.
- Add `FlattenException::setAsString()` to make the previous possible.
- Add `CliErrorRenderer` to render error on the CLI too. This means `VarDumper` is now a required dependency of `ErrorHandler`. This paves the way to use it also for rendering HTML - the logic there is much more advanced than what `HtmlErrorRenderer` provides and ever should provide.
- Make `BufferingLogger` map its collected logs to `error_log()` if they are not emptied before.
- Remove some classes that are not needed anymore (`ErrorRenderer`, `ErrorRendererPass`, `HtmlErrorRendererInterface`)
- Simplified the logic in `Debug::enable()` - nobody uses its arguments
- Fix a few issues found meanwhile.

With these changes, the component can be used standalone. One is now able to require only it, register it either with either `ErrorHandler::register()` or `Debug::enable()` and profit.

Commits
-------

d1bf1ca [ErrorHandler] help finish the PR
6c9157b [ErrorHandler] merge and remove the ErrorRenderer component
  • Loading branch information
fabpot committed Nov 12, 2019
2 parents 25c166f + d1bf1ca commit 0b867be27b33597e4aa6988e1b63d70eff6de2ac
Showing with 650 additions and 1,709 deletions.
  1. +15 −27 UPGRADE-4.4.md
  2. +0 −2 UPGRADE-5.0.md
  3. +0 −1 composer.json
  4. +1 −0 src/Symfony/Bridge/Twig/CHANGELOG.md
  5. +15 −29 ...Bundle/ErrorRenderer/TwigHtmlErrorRenderer.php → Bridge/Twig/ErrorRenderer/TwigErrorRenderer.php}
  6. +1 −1 src/Symfony/Bridge/Twig/Mime/NotificationEmail.php
  7. +12 −20 ...nderer/TwigHtmlErrorRendererTest.php → Bridge/Twig/Tests/ErrorRenderer/TwigErrorRendererTest.php}
  8. +2 −1 src/Symfony/Bridge/Twig/composer.json
  9. +0 −1 src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/UnusedTagsPass.php
  10. +0 −2 src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php
  11. +0 −6 src/Symfony/Bundle/FrameworkBundle/Resources/config/console.xml
  12. +13 −20 src/Symfony/Bundle/FrameworkBundle/Resources/config/error_renderer.xml
  13. +8 −0 src/Symfony/Bundle/FrameworkBundle/Resources/config/serializer.xml
  14. +1 −2 src/Symfony/Bundle/FrameworkBundle/composer.json
  15. +1 −1 src/Symfony/Bundle/SecurityBundle/Tests/Functional/JsonLoginTest.php
  16. +3 −0 src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/JsonLogin/config.yml
  17. +1 −0 src/Symfony/Bundle/SecurityBundle/composer.json
  18. +1 −2 src/Symfony/Bundle/TwigBundle/CHANGELOG.md
  19. +2 −3 src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml
  20. +2 −0 src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/TwigExtensionTest.php
  21. +3 −2 src/Symfony/Bundle/TwigBundle/Tests/Functional/EmptyAppTest.php
  22. +0 −1 src/Symfony/Bundle/TwigBundle/composer.json
  23. +2 −6 src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php
  24. +6 −6 src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionPanelController.php
  25. +2 −2 src/Symfony/Bundle/WebProfilerBundle/Resources/config/profiler.xml
  26. +2 −2 src/Symfony/Bundle/WebProfilerBundle/Tests/DependencyInjection/WebProfilerExtensionTest.php
  27. +0 −1 src/Symfony/Bundle/WebProfilerBundle/composer.json
  28. +1 −1 src/Symfony/Component/Debug/CHANGELOG.md
  29. +1 −1 src/Symfony/Component/Debug/Exception/FlattenException.php
  30. +21 −0 src/Symfony/Component/ErrorHandler/BufferingLogger.php
  31. +5 −25 src/Symfony/Component/ErrorHandler/Debug.php
  32. +28 −34 src/Symfony/Component/ErrorHandler/ErrorHandler.php
  33. +46 −0 src/Symfony/Component/ErrorHandler/ErrorRenderer/CliErrorRenderer.php
  34. +27 −0 src/Symfony/Component/ErrorHandler/ErrorRenderer/ErrorRendererInterface.php
  35. +12 −21 src/Symfony/Component/{ErrorRenderer → ErrorHandler}/ErrorRenderer/HtmlErrorRenderer.php
  36. +70 −0 src/Symfony/Component/ErrorHandler/ErrorRenderer/SerializerErrorRenderer.php
  37. +21 −9 src/Symfony/Component/{ErrorRenderer → ErrorHandler}/Exception/FlattenException.php
  38. 0 src/Symfony/Component/{ErrorRenderer → ErrorHandler}/Resources/assets/css/error.css
  39. 0 src/Symfony/Component/{ErrorRenderer → ErrorHandler}/Resources/assets/css/exception.css
  40. 0 src/Symfony/Component/{ErrorRenderer → ErrorHandler}/Resources/assets/css/exception_full.css
  41. 0 src/Symfony/Component/{ErrorRenderer → ErrorHandler}/Resources/assets/images/chevron-right.svg
  42. 0 src/Symfony/Component/{ErrorRenderer → ErrorHandler}/Resources/assets/images/favicon.png.base64
  43. 0 src/Symfony/Component/{ErrorRenderer → ErrorHandler}/Resources/assets/images/icon-book.svg
  44. 0 src/Symfony/Component/{ErrorRenderer → ErrorHandler}/Resources/assets/images/icon-minus-square-o.svg
  45. 0 src/Symfony/Component/{ErrorRenderer → ErrorHandler}/Resources/assets/images/icon-minus-square.svg
  46. 0 src/Symfony/Component/{ErrorRenderer → ErrorHandler}/Resources/assets/images/icon-plus-square-o.svg
  47. 0 src/Symfony/Component/{ErrorRenderer → ErrorHandler}/Resources/assets/images/icon-plus-square.svg
  48. 0 src/Symfony/Component/{ErrorRenderer → ErrorHandler}/Resources/assets/images/icon-support.svg
  49. 0 src/Symfony/Component/{ErrorRenderer → ErrorHandler}/Resources/assets/images/symfony-ghost.svg.php
  50. 0 src/Symfony/Component/{ErrorRenderer → ErrorHandler}/Resources/assets/images/symfony-logo.svg
  51. 0 src/Symfony/Component/{ErrorRenderer → ErrorHandler}/Resources/assets/js/exception.js
  52. +0 −25 src/Symfony/Component/ErrorHandler/Resources/stubs/Debug.php
  53. 0 src/Symfony/Component/{ErrorRenderer → ErrorHandler}/Resources/views/error.html.php
  54. 0 src/Symfony/Component/{ErrorRenderer → ErrorHandler}/Resources/views/exception.html.php
  55. +43 −0 src/Symfony/Component/ErrorHandler/Resources/views/exception_full.html.php
  56. 0 src/Symfony/Component/{ErrorRenderer → ErrorHandler}/Resources/views/logs.html.php
  57. 0 src/Symfony/Component/{ErrorRenderer → ErrorHandler}/Resources/views/trace.html.php
  58. 0 src/Symfony/Component/{ErrorRenderer → ErrorHandler}/Resources/views/traces.html.php
  59. 0 src/Symfony/Component/{ErrorRenderer → ErrorHandler}/Resources/views/traces_text.html.php
  60. +11 −30 src/Symfony/Component/ErrorHandler/Tests/ErrorHandlerTest.php
  61. +7 −20 src/Symfony/Component/{ErrorRenderer → ErrorHandler}/Tests/ErrorRenderer/HtmlErrorRendererTest.php
  62. +40 −0 src/Symfony/Component/ErrorHandler/Tests/ErrorRenderer/SerializerErrorRendererTest.php
  63. +2 −2 src/Symfony/Component/{ErrorRenderer → ErrorHandler}/Tests/Exception/FlattenExceptionTest.php
  64. +11 −8 src/Symfony/Component/ErrorHandler/Tests/phpt/exception_rethrown.phpt
  65. +5 −9 src/Symfony/Component/ErrorHandler/composer.json
  66. +0 −3 src/Symfony/Component/ErrorRenderer/.gitattributes
  67. +0 −3 src/Symfony/Component/ErrorRenderer/.gitignore
  68. +0 −7 src/Symfony/Component/ErrorRenderer/CHANGELOG.md
  69. +0 −125 src/Symfony/Component/ErrorRenderer/Command/DebugCommand.php
  70. +0 −71 src/Symfony/Component/ErrorRenderer/DependencyInjection/ErrorRendererPass.php
  71. +0 −44 src/Symfony/Component/ErrorRenderer/DependencyInjection/LazyLoadingErrorRenderer.php
  72. +0 −77 src/Symfony/Component/ErrorRenderer/ErrorRenderer.php
  73. +0 −32 src/Symfony/Component/ErrorRenderer/ErrorRenderer/ErrorRendererInterface.php
  74. +0 −60 src/Symfony/Component/ErrorRenderer/ErrorRenderer/JsonErrorRenderer.php
  75. +0 −104 src/Symfony/Component/ErrorRenderer/ErrorRenderer/TxtErrorRenderer.php
  76. +0 −125 src/Symfony/Component/ErrorRenderer/ErrorRenderer/XmlErrorRenderer.php
  77. +0 −16 src/Symfony/Component/ErrorRenderer/Exception/ErrorRendererNotFoundException.php
  78. +0 −19 src/Symfony/Component/ErrorRenderer/LICENSE
  79. +0 −12 src/Symfony/Component/ErrorRenderer/README.md
  80. +0 −41 src/Symfony/Component/ErrorRenderer/Resources/views/exception_full.html.php
  81. +0 −88 src/Symfony/Component/ErrorRenderer/Tests/Command/DebugCommandTest.php
  82. +0 −67 src/Symfony/Component/ErrorRenderer/Tests/DependencyInjection/ErrorRendererPassTest.php
  83. +0 −66 src/Symfony/Component/ErrorRenderer/Tests/DependencyInjection/LazyLoadingErrorRendererTest.php
  84. +0 −76 src/Symfony/Component/ErrorRenderer/Tests/ErrorRenderer/JsonErrorRendererTest.php
  85. +0 −69 src/Symfony/Component/ErrorRenderer/Tests/ErrorRenderer/TxtErrorRendererTest.php
  86. +0 −75 src/Symfony/Component/ErrorRenderer/Tests/ErrorRenderer/XmlErrorRendererTest.php
  87. +0 −56 src/Symfony/Component/ErrorRenderer/Tests/ErrorRendererTest.php
  88. +0 −47 src/Symfony/Component/ErrorRenderer/composer.json
  89. +0 −30 src/Symfony/Component/ErrorRenderer/phpunit.xml.dist
  90. +8 −13 src/Symfony/Component/HttpKernel/Controller/ErrorController.php
  91. +1 −1 src/Symfony/Component/HttpKernel/DataCollector/ExceptionDataCollector.php
  92. +22 −2 src/Symfony/Component/HttpKernel/EventListener/ErrorListener.php
  93. +1 −1 src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php
  94. +10 −39 src/Symfony/Component/HttpKernel/Tests/Controller/ErrorControllerTest.php
  95. +1 −1 src/Symfony/Component/HttpKernel/Tests/DataCollector/ExceptionDataCollectorTest.php
  96. +28 −0 src/Symfony/Component/HttpKernel/Tests/EventListener/ErrorListenerTest.php
  97. +1 −5 src/Symfony/Component/HttpKernel/composer.json
  98. +1 −1 src/Symfony/Component/Messenger/EventListener/SendFailedMessageToFailureTransportListener.php
  99. +1 −1 src/Symfony/Component/Messenger/Stamp/RedeliveryStamp.php
  100. +1 −1 src/Symfony/Component/Messenger/Tests/Stamp/RedeliveryStampTest.php
  101. +0 −1 src/Symfony/Component/Messenger/composer.json
  102. +1 −0 src/Symfony/Component/Serializer/CHANGELOG.md
  103. +74 −0 src/Symfony/Component/Serializer/Normalizer/ProblemNormalizer.php
  104. +48 −0 src/Symfony/Component/Serializer/Tests/Normalizer/ProblemNormalizerTest.php
  105. +8 −7 src/Symfony/Component/Serializer/composer.json
@@ -18,8 +18,6 @@ Console
Debug
-----

* Deprecated the `Debug` class, use the one from the `ErrorRenderer` component instead
* Deprecated the `FlattenException` class, use the one from the `ErrorRenderer` component instead
* Deprecated the component in favor of the `ErrorHandler` component

Config
@@ -306,48 +304,38 @@ TwigBundle
```

* Deprecated the `ExceptionController` and `PreviewErrorController` controllers, use `ErrorController` from the HttpKernel component instead
* Deprecated all built-in error templates, use the error renderer mechanism of the `ErrorRenderer` component
* Deprecated all built-in error templates, use the error renderer mechanism of the `ErrorHandler` component
* Deprecated loading custom error templates in non-html formats. Custom HTML error pages based on Twig keep working as before:

Before (`templates/bundles/TwigBundle/Exception/error.jsonld.twig`):
Before (`templates/bundles/TwigBundle/Exception/error.json.twig`):
```twig
{
"@id": "https://example.com",
"@type": "error",
"@context": {
"title": "{{ status_text }}",
"code": {{ status_code }},
"message": "{{ exception.message }}"
}
"type": "https://example.com/error",
"title": "{{ status_text }}",
"status": {{ status_code }}
}
```

After (`App\ErrorRenderer\JsonLdErrorRenderer`):
After (`App\Serializer\ProblemJsonNormalizer`):
```php
class JsonLdErrorRenderer implements ErrorRendererInterface
class ProblemJsonNormalizer implements NormalizerInterface
{
public static function getFormat(): string
public function normalize($exception, $format = null, array $context = [])
{
return 'jsonld';
return [
'type' => 'https://example.com/error',
'title' => $exception->getStatusText(),
'status' => $exception->getStatusCode(),
];
}
public function render(FlattenException $exception): string
public function supportsNormalization($data, $format = null)
{
return json_encode([
'@id' => 'https://example.com',
'@type' => 'error',
'@context' => [
'title' => $exception->getTitle(),
'code' => $exception->getStatusCode(),
'message' => $exception->getMessage(),
],
]);
return 'json' === $format && $data instanceof FlattenException;
}
}
```

Configure your rendering service tagging it with `error_renderer.renderer`.

Validator
---------

@@ -57,8 +57,6 @@ Console
Debug
-----

* Removed the `Debug` class, use the one from the `ErrorRenderer` component instead
* Removed the `FlattenException` class, use the one from the `ErrorRenderer` component instead
* Removed the component in favor of the `ErrorHandler` component

DependencyInjection
@@ -48,7 +48,6 @@
"symfony/dom-crawler": "self.version",
"symfony/dotenv": "self.version",
"symfony/error-handler": "self.version",
"symfony/error-renderer": "self.version",
"symfony/event-dispatcher": "self.version",
"symfony/expression-language": "self.version",
"symfony/filesystem": "self.version",
@@ -4,6 +4,7 @@ CHANGELOG
4.4.0
-----

* added a new `TwigErrorRenderer` for `html` format, integrated with the `ErrorHandler` component
* marked all classes extending twig as `@final`
* deprecated to pass `$rootDir` and `$fileLinkFormatter` as 5th and 6th argument respectively to the
`DebugCommand::__construct()` method, swap the variables position.
@@ -9,11 +9,11 @@
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\TwigBundle\ErrorRenderer;
namespace Symfony\Bridge\Twig\ErrorRenderer;
use Symfony\Component\ErrorRenderer\ErrorRenderer\ErrorRendererInterface;
use Symfony\Component\ErrorRenderer\ErrorRenderer\HtmlErrorRenderer;
use Symfony\Component\ErrorRenderer\Exception\FlattenException;
use Symfony\Component\ErrorHandler\ErrorRenderer\ErrorRendererInterface;
use Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Loader\ExistsLoaderInterface;
@@ -24,50 +24,36 @@
*
* @author Yonel Ceruto <yonelceruto@gmail.com>
*/
class TwigHtmlErrorRenderer implements ErrorRendererInterface
class TwigErrorRenderer implements ErrorRendererInterface
{
private $twig;
private $htmlErrorRenderer;
private $fallbackErrorRenderer;
private $debug;
public function __construct(Environment $twig, HtmlErrorRenderer $htmlErrorRenderer, bool $debug = false)
public function __construct(Environment $twig, HtmlErrorRenderer $fallbackErrorRenderer = null, bool $debug = false)
{
$this->twig = $twig;
$this->htmlErrorRenderer = $htmlErrorRenderer;
$this->fallbackErrorRenderer = $fallbackErrorRenderer ?? new HtmlErrorRenderer();
$this->debug = $debug;
}
/**
* {@inheritdoc}
*/
public static function getFormat(): string
public function render(\Throwable $exception): FlattenException
{
return 'html';
}
/**
* {@inheritdoc}
*/
public function render(FlattenException $exception): string
{
$debug = $this->debug && ($exception->getHeaders()['X-Debug'] ?? true);
if ($debug) {
return $this->htmlErrorRenderer->render($exception);
}
$template = $this->findTemplate($exception->getStatusCode());
$exception = $this->fallbackErrorRenderer->render($exception);
if (null === $template) {
return $this->htmlErrorRenderer->render($exception);
if ($this->debug || !$template = $this->findTemplate($exception->getStatusCode())) {
return $exception;
}
return $this->twig->render($template, [
return $exception->setAsString($this->twig->render($template, [
'legacy' => false, // to be removed in 5.0
'exception' => $exception,
'status_code' => $exception->getStatusCode(),
'status_text' => $exception->getTitle(),
]);
'status_text' => $exception->getStatusText(),
]));
}
private function findTemplate(int $statusCode): ?string
@@ -11,7 +11,7 @@
namespace Symfony\Bridge\Twig\Mime;
use Symfony\Component\ErrorRenderer\Exception\FlattenException;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\Mime\Header\Headers;
use Symfony\Component\Mime\Part\AbstractPart;
use Twig\Extra\CssInliner\CssInlinerExtension;
@@ -9,21 +9,21 @@
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\TwigBundle\Tests\ErrorRenderer;
namespace Symfony\Bridge\Twig\Tests\ErrorRenderer;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle\TwigBundle\ErrorRenderer\TwigHtmlErrorRenderer;
use Symfony\Component\ErrorRenderer\ErrorRenderer\HtmlErrorRenderer;
use Symfony\Component\ErrorRenderer\Exception\FlattenException;
use Symfony\Bridge\Twig\ErrorRenderer\TwigErrorRenderer;
use Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Twig\Environment;
use Twig\Loader\ArrayLoader;
class TwigHtmlErrorRendererTest extends TestCase
class TwigErrorRendererTest extends TestCase
{
public function testFallbackToNativeRendererIfDebugOn()
{
$exception = FlattenException::createFromThrowable(new \Exception());
$exception = new \Exception();
$twig = $this->createMock(Environment::class);
$nativeRenderer = $this->createMock(HtmlErrorRenderer::class);
@@ -33,12 +33,12 @@ public function testFallbackToNativeRendererIfDebugOn()
->with($exception)
;
(new TwigHtmlErrorRenderer($twig, $nativeRenderer, true))->render($exception);
(new TwigErrorRenderer($twig, $nativeRenderer, true))->render(new \Exception());
}
public function testFallbackToNativeRendererIfCustomTemplateNotFound()
{
$exception = FlattenException::createFromThrowable(new NotFoundHttpException());
$exception = new NotFoundHttpException();
$twig = new Environment(new ArrayLoader([]));
@@ -47,27 +47,19 @@ public function testFallbackToNativeRendererIfCustomTemplateNotFound()
->expects($this->once())
->method('render')
->with($exception)
->willReturn(FlattenException::createFromThrowable($exception))
;
(new TwigHtmlErrorRenderer($twig, $nativeRenderer, false))->render($exception);
(new TwigErrorRenderer($twig, $nativeRenderer, false))->render($exception);
}
public function testRenderCustomErrorTemplate()
{
$exception = FlattenException::createFromThrowable(new NotFoundHttpException());
$twig = new Environment(new ArrayLoader([
'@Twig/Exception/error404.html.twig' => '<h1>Page Not Found</h1>',
]));
$exception = (new TwigErrorRenderer($twig))->render(new NotFoundHttpException());
$nativeRenderer = $this->createMock(HtmlErrorRenderer::class);
$nativeRenderer
->expects($this->never())
->method('render')
;
$content = (new TwigHtmlErrorRenderer($twig, $nativeRenderer, false))->render($exception);
$this->assertSame('<h1>Page Not Found</h1>', $content);
$this->assertSame('<h1>Page Not Found</h1>', $exception->getAsString());
}
}
@@ -24,10 +24,11 @@
"egulias/email-validator": "^2.1.10",
"symfony/asset": "^3.4|^4.0|^5.0",
"symfony/dependency-injection": "^3.4|^4.0|^5.0",
"symfony/error-handler": "^4.4|^5.0",
"symfony/finder": "^3.4|^4.0|^5.0",
"symfony/form": "^4.4|^5.0",
"symfony/http-foundation": "^4.3|^5.0",
"symfony/http-kernel": "^3.4|^4.0",
"symfony/http-kernel": "^4.4",
"symfony/mime": "^4.3|^5.0",
"symfony/polyfill-intl-icu": "~1.0",
"symfony/routing": "^3.4|^4.0|^5.0",
@@ -32,7 +32,6 @@ class UnusedTagsPass implements CompilerPassInterface
'controller.service_arguments',
'config_cache.resource_checker',
'data_collector',
'error_renderer.renderer',
'form.type',
'form.type_extension',
'form.type_guesser',
@@ -33,7 +33,6 @@
use Symfony\Component\DependencyInjection\Compiler\RegisterReverseContainerPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\ErrorHandler\ErrorHandler;
use Symfony\Component\ErrorRenderer\DependencyInjection\ErrorRendererPass;
use Symfony\Component\EventDispatcher\DependencyInjection\RegisterListenersPass;
use Symfony\Component\Form\DependencyInjection\FormPass;
use Symfony\Component\HttpClient\DependencyInjection\HttpClientPass;
@@ -92,7 +91,6 @@ public function build(ContainerBuilder $container)
KernelEvents::FINISH_REQUEST,
];
$container->addCompilerPass(new ErrorRendererPass());
$container->addCompilerPass(new LoggerPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, -32);
$container->addCompilerPass(new RegisterControllerArgumentLocatorsPass());
$container->addCompilerPass(new RemoveEmptyControllerArgumentLocatorsPass(), PassConfig::TYPE_BEFORE_REMOVING);
@@ -194,12 +194,6 @@
<tag name="console.command" command="debug:form" />
</service>

<service id="console.command.error_renderer_debug" class="Symfony\Component\ErrorRenderer\Command\DebugCommand">
<argument type="collection" /> <!-- All error renderers are injected here by ErrorRendererPass -->
<argument type="service" id="debug.file_link_formatter" on-invalid="null" />
<tag name="console.command" command="debug:error-renderer" />
</service>

<service id="console.command.secrets_set" class="Symfony\Bundle\FrameworkBundle\Command\SecretsSetCommand">
<argument type="service" id="secrets.vault" />
<argument type="service" id="secrets.local_vault" on-invalid="ignore" />
@@ -5,12 +5,7 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd">

<services>
<service id="error_renderer" class="Symfony\Component\ErrorRenderer\DependencyInjection\LazyLoadingErrorRenderer">
<argument /> <!-- error renderer locator -->
</service>

<service id="error_renderer.renderer.html" class="Symfony\Component\ErrorRenderer\ErrorRenderer\HtmlErrorRenderer">
<tag name="error_renderer.renderer" />
<service id="error_handler.error_renderer.html" class="Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer">
<argument>%kernel.debug%</argument>
<argument>%kernel.charset%</argument>
<argument type="service" id="debug.file_link_formatter" on-invalid="null" />
@@ -19,21 +14,19 @@
<argument type="service" id="logger" on-invalid="null" />
</service>

<service id="error_renderer.renderer.json" class="Symfony\Component\ErrorRenderer\ErrorRenderer\JsonErrorRenderer">
<tag name="error_renderer.renderer" />
<argument>%kernel.debug%</argument>
<service id="error_handler.error_renderer.serializer" class="Symfony\Component\ErrorHandler\ErrorRenderer\SerializerErrorRenderer">
<argument type="service" id="serializer" />
<argument type="service">
<service>
<factory class="Symfony\Component\ErrorHandler\ErrorRenderer\SerializerErrorRenderer" method="getPreferredFormat" />
<argument type="service" id="request_stack" />
</service>
</argument>
<argument type="service" id="error_renderer.html" />
</service>

<service id="error_renderer.renderer.xml" class="Symfony\Component\ErrorRenderer\ErrorRenderer\XmlErrorRenderer">
<tag name="error_renderer.renderer" format="atom" />
<tag name="error_renderer.renderer" />
<argument>%kernel.debug%</argument>
<argument>%kernel.charset%</argument>
</service>

<service id="error_renderer.renderer.txt" class="Symfony\Component\ErrorRenderer\ErrorRenderer\TxtErrorRenderer">
<tag name="error_renderer.renderer" />
<argument>%kernel.debug%</argument>
</service>
<service id="error_renderer.html" alias="error_handler.error_renderer.html" />
<service id="error_renderer.serializer" alias="error_handler.error_renderer.serializer" />
<service id="error_renderer" alias="error_renderer.html" />
</services>
</container>
@@ -12,6 +12,8 @@
<services>
<defaults public="false" />

<service id="error_renderer" alias="error_renderer.serializer" />

<service id="serializer" class="Symfony\Component\Serializer\Serializer" public="true">
<argument type="collection" />
<argument type="collection" />
@@ -59,6 +61,12 @@
<tag name="serializer.normalizer" priority="-900" />
</service>

<service id="serializer.normalizer.problem" class="Symfony\Component\Serializer\Normalizer\ProblemNormalizer">
<argument>%kernel.debug%</argument>
<!-- Run before serializer.normalizer.object -->
<tag name="serializer.normalizer" priority="-890" />
</service>

<service id="serializer.normalizer.object" class="Symfony\Component\Serializer\Normalizer\ObjectNormalizer">
<argument type="service" id="serializer.mapping.class_metadata_factory" />
<argument type="service" id="serializer.name_converter.metadata_aware" />
@@ -21,7 +21,6 @@
"symfony/cache": "^4.4|^5.0",
"symfony/config": "^4.3.4|^5.0",
"symfony/dependency-injection": "^4.4|^5.0",
"symfony/error-renderer": "^4.4|^5.0",
"symfony/http-foundation": "^4.4|^5.0",
"symfony/http-kernel": "^4.4",
"symfony/polyfill-mbstring": "~1.0",
@@ -50,7 +49,7 @@
"symfony/process": "^3.4|^4.0|^5.0",
"symfony/security-csrf": "^3.4|^4.0|^5.0",
"symfony/security-http": "^3.4|^4.0|^5.0",
"symfony/serializer": "^4.3|^5.0",
"symfony/serializer": "^4.4|^5.0",
"symfony/stopwatch": "^3.4|^4.0|^5.0",
"symfony/translation": "^4.4|^5.0",
"symfony/templating": "^3.4|^4.0|^5.0",

0 comments on commit 0b867be

Please sign in to comment.
You can’t perform that action at this time.