Skip to content

Commit df79a13

Browse files
committed
make ExceptionEvent handle all throwables
1 parent da437e2 commit df79a13

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

src/Symfony/Component/HttpKernel/Event/ExceptionEvent.php

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,38 +29,33 @@
2929
*/
3030
final class ExceptionEvent extends RequestEvent
3131
{
32-
/**
33-
* The exception object.
34-
*
35-
* @var \Exception
36-
*/
37-
private $exception;
32+
private $throwable;
3833

3934
/**
4035
* @var bool
4136
*/
4237
private $allowCustomResponseCode = false;
4338

44-
public function __construct(HttpKernelInterface $kernel, Request $request, int $requestType, \Exception $e)
39+
public function __construct(HttpKernelInterface $kernel, Request $request, int $requestType, \Throwable $e)
4540
{
4641
parent::__construct($kernel, $request, $requestType);
4742

48-
$this->setException($e);
43+
$this->setThrowable($e);
4944
}
5045

51-
public function getException(): \Exception
46+
public function getThrowable(): \Throwable
5247
{
53-
return $this->exception;
48+
return $this->throwable;
5449
}
5550

5651
/**
5752
* Replaces the thrown exception.
5853
*
5954
* This exception will be thrown if no response is set in the event.
6055
*/
61-
public function setException(\Exception $exception): void
56+
public function setThrowable(\Throwable $exception): void
6257
{
63-
$this->exception = $exception;
58+
$this->throwable = $exception;
6459
}
6560

6661
/**

0 commit comments

Comments
 (0)
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