diff --git a/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php b/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php index e396788a62022b38b4109ec92ce83741edb6d0a6..f03324cc23946babbfea27456d8ccdacc683a8f5 100644 --- a/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php +++ b/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php @@ -817,11 +817,16 @@ class ContentObjectRenderer implements LoggerAwareInterface // Content rendering Exceptions indicate a critical problem which should not be // caught e.g. when something went wrong with Exception handling itself throw $exception; - } catch (\Exception $exception) { + } catch (\Throwable $exception) { $exceptionHandler = $this->createExceptionHandler($configuration); if ($exceptionHandler === null) { throw $exception; } + // Ensure that the exception handler receives an \Exception instance, + // which is required by the \ExceptionHandlerInterface. + if (!$exception instanceof \Exception) { + $exception = new \Exception($exception->getMessage(), 1698347363, $exception); + } $content = $exceptionHandler->handle($exception, $contentObject, $configuration); }