Skip to content
Snippets Groups Projects
Commit 9819ed85 authored by Sascha Egerer's avatar Sascha Egerer Committed by Benni Mack
Browse files

[BUGFIX] Make ContentRenderer catch more errors

The ContentObjectRenderer catches \Exception's
that occur during the rendering of a content element.
However, since PHP 7, there is a \TypeError exception that
occurs, for example, if the given type does not match the
declared type.
Because \TypeError is not a subtype of \Exception, these
errors are not caught in the production context, and instead
of not rendering a single content element, the whole page
is not rendered.
Since all types of \Throwable are essentially errors that
will interrupt the rendering process, the catch block must
accommodate all of these, not just implementations of \Exception.

Resolves: #102044
Releases: main, 12.4, 11.5
Change-Id: If6218f013caf21d7fcd2c0d0d5b6b51c3bf9963e
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/81573


Reviewed-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarcore-ci <typo3@b13.com>
Reviewed-by: default avatarGeorg Ringer <georg.ringer@gmail.com>
Tested-by: default avatarGeorg Ringer <georg.ringer@gmail.com>
parent 13f9d704
Branches
Tags
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment