private getResponseFromPageHandler ( string $type ) : |
||
$type | string | |
return |
private function getResponseFromPageHandler($type)
{
$type = 'error_' . $type;
if (!isset($GLOBALS['TL_PTY'][$type]) || !class_exists($GLOBALS['TL_PTY'][$type])) {
return null;
}
/** @var PageError404 $pageHandler */
$pageHandler = new $GLOBALS['TL_PTY'][$type]();
try {
return $pageHandler->getResponse();
} catch (RedirectResponseException $e) {
return $e->getResponse();
} catch (\Exception $e) {
return null;
}
}