You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I want to throw a 410 (404) error inside my Controller. However, I only get a blank Page using the error handler.
To Reproduce
Steps to reproduce the behavior:
Call the ErrorHandler in Controller:
$message = 'The page you requested is no longer available.';
$errorHandler = $this->getErrorHandlerFromSite($GLOBALS['TYPO3_REQUEST'], 410);
if ($errorHandler instanceof PageErrorHandlerInterface) {
$response = $errorHandler->handlePageError($GLOBALS['TYPO3_REQUEST'], $message);
} else {
$response = $this->handleDefaultError($GLOBALS['TYPO3_REQUEST'], 410, $message);
}
return $this->throwStatus(410, $message, $response->getBody()->getContents());
Expected behavior
Error page shows
Additional context
Interesting: (string) $response->getBody() returns the HTML of the current Page and the Error Page. $response->getBody()->getContents() is a empty string.
The text was updated successfully, but these errors were encountered:
Describe the bug
I want to throw a 410 (404) error inside my Controller. However, I only get a blank Page using the error handler.
To Reproduce
Steps to reproduce the behavior:
Call the ErrorHandler in Controller:
Expected behavior
Error page shows
Additional context
Interesting: (string) $response->getBody() returns the HTML of the current Page and the Error Page. $response->getBody()->getContents() is a empty string.
The text was updated successfully, but these errors were encountered: