|
11 | 11 |
|
12 | 12 | namespace Symfony\Bundle\WebProfilerBundle\Controller;
|
13 | 13 |
|
14 |
| -use Symfony\Component\Debug\ExceptionHandler; |
| 14 | +use Symfony\Component\ErrorHandler\ErrorException; |
15 | 15 | use Symfony\Component\HttpFoundation\Response;
|
16 | 16 | use Symfony\Component\HttpKernel\Debug\FileLinkFormatter;
|
17 | 17 | use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
@@ -61,9 +61,9 @@ public function showAction($token)
|
61 | 61 | $template = $this->getTemplate();
|
62 | 62 |
|
63 | 63 | if (!$this->twig->getLoader()->exists($template)) {
|
64 |
| - $handler = new ExceptionHandler($this->debug, $this->twig->getCharset(), $this->fileLinkFormat); |
| 64 | + $errorException = new ErrorException($this->debug, $this->twig->getCharset(), $this->fileLinkFormat); |
65 | 65 |
|
66 |
| - return new Response($handler->getContent($exception), 200, ['Content-Type' => 'text/html']); |
| 66 | + return new Response($errorException->getHtmlBody($exception), 200, ['Content-Type' => 'text/html']); |
67 | 67 | }
|
68 | 68 |
|
69 | 69 | $code = $exception->getStatusCode();
|
@@ -97,13 +97,12 @@ public function cssAction($token)
|
97 | 97 |
|
98 | 98 | $this->profiler->disable();
|
99 | 99 |
|
100 |
| - $exception = $this->profiler->loadProfile($token)->getCollector('exception')->getException(); |
101 | 100 | $template = $this->getTemplate();
|
102 | 101 |
|
103 | 102 | if (!$this->templateExists($template)) {
|
104 |
| - $handler = new ExceptionHandler($this->debug, $this->twig->getCharset(), $this->fileLinkFormat); |
| 103 | + $errorException = new ErrorException($this->debug, $this->twig->getCharset(), $this->fileLinkFormat); |
105 | 104 |
|
106 |
| - return new Response($handler->getStylesheet($exception), 200, ['Content-Type' => 'text/css']); |
| 105 | + return new Response($errorException->getStylesheet(), 200, ['Content-Type' => 'text/css']); |
107 | 106 | }
|
108 | 107 |
|
109 | 108 | return new Response($this->twig->render('@WebProfiler/Collector/exception.css.twig'), 200, ['Content-Type' => 'text/css']);
|
|
0 commit comments