[HttpKernel] fix leftover
This commit is contained in:
parent
fdb9181d67
commit
cbc4efc345
@ -37,12 +37,12 @@ class ErrorController
|
||||
$this->errorRenderer = $errorRenderer;
|
||||
}
|
||||
|
||||
public function __invoke(Request $request, FlattenException $e): Response
|
||||
public function __invoke(Request $request, FlattenException $exception): Response
|
||||
{
|
||||
try {
|
||||
return new Response($this->errorRenderer->render($e, $request->getPreferredFormat()), $e->getStatusCode(), $e->getHeaders());
|
||||
return new Response($this->errorRenderer->render($exception, $request->getPreferredFormat()), $exception->getStatusCode(), $exception->getHeaders());
|
||||
} catch (ErrorRendererNotFoundException $_) {
|
||||
return new Response($this->errorRenderer->render($e), $e->getStatusCode(), $e->getHeaders());
|
||||
return new Response($this->errorRenderer->render($exception), $exception->getStatusCode(), $exception->getHeaders());
|
||||
}
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ class ErrorController
|
||||
*/
|
||||
$subRequest = $request->duplicate(null, null, [
|
||||
'_controller' => $this->controller,
|
||||
'e' => $exception,
|
||||
'exception' => $exception,
|
||||
'logger' => null,
|
||||
'showException' => false,
|
||||
]);
|
||||
|
@ -103,7 +103,7 @@ class ErrorControllerTest extends TestCase
|
||||
->method('handle')
|
||||
->with(
|
||||
$this->callback(function (Request $request) use ($_controller, $code) {
|
||||
$exception = $request->attributes->get('e');
|
||||
$exception = $request->attributes->get('exception');
|
||||
|
||||
$this->assertSame($_controller, $request->attributes->get('_controller'));
|
||||
$this->assertInstanceOf(FlattenException::class, $exception);
|
||||
|
Reference in New Issue
Block a user