Skip to content

Commit 4f60237

Browse files
author
Antonio Pauletich
committed
Handle all throwable instead of just exceptions
1 parent 4b3de44 commit 4f60237

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Exception/EventSubscriber/ExceptionListener.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,14 @@ public function onKernelException(ExceptionEvent $event): void
100100
}
101101
}
102102

103-
private function buildError(\Exception $exception): Error
103+
private function buildError(\Throwable $exception): Error
104104
{
105105
if (class_exists('\Symfony\Component\ErrorHandler\Exception\FlattenException')) {
106106
/** @var callable $callable */
107-
$callable = ['Symfony\Component\ErrorHandler\Exception\FlattenException', 'create'];
107+
$callable = ['Symfony\Component\ErrorHandler\Exception\FlattenException', 'createFromThrowable'];
108108
$e = \call_user_func($callable, $exception);
109109
} else {
110-
$e = FlattenException::create($exception);
110+
$e = FlattenException::createFromThrowable($exception);
111111
}
112112

113113
return new Error(

0 commit comments

Comments
 (0)