Issue Bug Closed

#95586PageNotFound handling doesn't work in debug mode

Sascha Wilking 10/12/21, 12:29 updated 10/04/22, 14:19

Description

If debug mode is enabled, the page not found handler throws an exception:

Error handler could not fetch error page “http://localhost/404”, reason: PHP Warning: Undefined property: GuzzleHttp\Psr7\Response::$getStatusCode in /private/typo3/sysext/core/Classes/Error/PageErrorHandler/PageContentErrorHandler.php line 147

Settings in SiteConfiguration:
errorCode = 404
errorHandler: Show content from page

To fix it:
Use “if ($response->getStatusCode() = 200)" instead of "if ($response->getStatusCode = 200)”

Reviews 2