%A', $content);
+ }
+
+ public function testTxtExceptionContent()
+ {
+ $handler = new ExceptionHandler(true);
+ $content = $handler->getTxt(new \RuntimeException('Foo'));
+
+ $this->assertStringMatchesFormat("[title] Internal Server Error\n[status] 500\n[detail] Foo\n[1] RuntimeException: Foo\nin ExceptionHandlerTest.php line %A", $content);
+ }
}
diff --git a/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php b/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php
index 8e31ecc944e37..e32532cf0bdc4 100644
--- a/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php
+++ b/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php
@@ -151,10 +151,10 @@ protected function duplicateRequest(\Exception $exception, Request $request)
{
$attributes = [
'exception' => $exception = FlattenException::create($exception),
- '_controller' => $this->controller ?: function () use ($exception) {
+ '_controller' => $this->controller ?: function () use ($exception, $request) {
$handler = new ExceptionHandler($this->debug, $this->charset, $this->fileLinkFormat);
- return new Response($handler->getHtml($exception), $exception->getStatusCode(), $exception->getHeaders());
+ return new Response($handler->getFormattedContent($exception, $request->getRequestFormat()), $exception->getStatusCode(), $exception->getHeaders());
},
'logger' => $this->logger instanceof DebugLoggerInterface ? $this->logger : null,
];
diff --git a/src/Symfony/Component/HttpKernel/composer.json b/src/Symfony/Component/HttpKernel/composer.json
index ca818d16707ab..25ce022c749ef 100644
--- a/src/Symfony/Component/HttpKernel/composer.json
+++ b/src/Symfony/Component/HttpKernel/composer.json
@@ -48,6 +48,7 @@
"conflict": {
"symfony/browser-kit": "<4.3",
"symfony/config": "<3.4",
+ "symfony/debug": "<4.3",
"symfony/dependency-injection": "<4.2",
"symfony/translation": "<4.2",
"symfony/var-dumper": "<4.1.1",
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy