8000 [HttpKernel] added support for FlattenException in ExceptionHandler::… · helmer/symfony@766b88f · GitHub
[go: up one dir, main page]

Skip to content

Commit 766b88f

Browse files
committed
[HttpKernel] added support for FlattenException in ExceptionHandler::createResponse
1 parent 6e60967 commit 766b88f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Symfony/Component/HttpKernel/Debug/ExceptionHandler.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,18 @@ public function handle(\Exception $exception)
6767
/**
6868
* Creates the error Response associated with the given Exception.
6969
*
70-
* @param \Exception $exception An \Exception instance
70+
* @param \Exception|FlattenException $exception An \Exception instance
7171
*
7272
* @return Response A Response instance
7373
*/
74-
public function createResponse(\Exception $exception)
74+
public function createResponse($exception)
7575
{
7676
$content = '';
7777
$title = '';
7878
try {
79-
$exception = FlattenException::create($exception);
79+
if (!$exception instanceof FlattenException) {
80+
$exception = FlattenException::create($exception);
81+
}
8082

8183
switch ($exception->getStatusCode()) {
8284
case 404:

0 commit comments

Comments
 (0)
0