‪TYPO3CMS  11.5
TYPO3\CMS\Frontend\Controller\ErrorController Class Reference

Public Member Functions

ResponseInterface internalErrorAction (ServerRequestInterface $request, string $message, array $reasons=[])
 
ResponseInterface unavailableAction (ServerRequestInterface $request, string $message, array $reasons=[])
 
ResponseInterface pageNotFoundAction (ServerRequestInterface $request, string $message, array $reasons=[])
 
ResponseInterface accessDeniedAction (ServerRequestInterface $request, string $message, array $reasons=[])
 

Protected Member Functions

bool isPageUnavailableHandlerConfigured ()
 
PageErrorHandlerInterface null getErrorHandlerFromSite (ServerRequestInterface $request, int $statusCode)
 
ResponseInterface handleDefaultError (ServerRequestInterface $request, int $statusCode, string $reason='')
 

Detailed Description

Handles error requests, returns a response object.

Definition at line 38 of file ErrorController.php.

Member Function Documentation

◆ accessDeniedAction()

ResponseInterface TYPO3\CMS\Frontend\Controller\ErrorController::accessDeniedAction ( ServerRequestInterface  $request,
string  $message,
array  $reasons = [] 
)

Used for creating a 403 response ("Access denied"), but if configured, a RedirectResponse could be returned as well.

Parameters
ServerRequestInterface$request
string$message
array$reasons
Returns
‪ResponseInterface
Exceptions
PageNotFoundException

Definition at line 117 of file ErrorController.php.

References TYPO3\CMS\Frontend\Controller\ErrorController\getErrorHandlerFromSite(), and TYPO3\CMS\Frontend\Controller\ErrorController\handleDefaultError().

◆ getErrorHandlerFromSite()

PageErrorHandlerInterface null TYPO3\CMS\Frontend\Controller\ErrorController::getErrorHandlerFromSite ( ServerRequestInterface  $request,
int  $statusCode 
)
protected

Checks if a site is configured, and an error handler is configured for this specific status code.

Parameters
ServerRequestInterface$request
int$statusCode
Returns
‪PageErrorHandlerInterface|null

Definition at line 148 of file ErrorController.php.

Referenced by TYPO3\CMS\Frontend\Controller\ErrorController\accessDeniedAction(), TYPO3\CMS\Frontend\Controller\ErrorController\internalErrorAction(), TYPO3\CMS\Frontend\Controller\ErrorController\pageNotFoundAction(), and TYPO3\CMS\Frontend\Controller\ErrorController\unavailableAction().

◆ handleDefaultError()

ResponseInterface TYPO3\CMS\Frontend\Controller\ErrorController::handleDefaultError ( ServerRequestInterface  $request,
int  $statusCode,
string  $reason = '' 
)
protected

Ensures that a response object is created as a "fallback" when no error handler is configured.

Parameters
ServerRequestInterface$request
int$statusCode
string$reason
Returns
‪ResponseInterface

Definition at line 169 of file ErrorController.php.

References TYPO3\CMS\Core\Messaging\AbstractMessage\ERROR.

Referenced by TYPO3\CMS\Frontend\Controller\ErrorController\accessDeniedAction(), TYPO3\CMS\Frontend\Controller\ErrorController\internalErrorAction(), TYPO3\CMS\Frontend\Controller\ErrorController\pageNotFoundAction(), and TYPO3\CMS\Frontend\Controller\ErrorController\unavailableAction().

◆ internalErrorAction()

ResponseInterface TYPO3\CMS\Frontend\Controller\ErrorController::internalErrorAction ( ServerRequestInterface  $request,
string  $message,
array  $reasons = [] 
)

Used for creating a 500 response ("Internal Server Error"), usually due some misconfiguration but if configured, a RedirectResponse could be returned as well.

Parameters
ServerRequestInterface$request
string$message
array$reasons
Returns
‪ResponseInterface
Exceptions
InternalServerErrorException

Definition at line 50 of file ErrorController.php.

References TYPO3\CMS\Frontend\Controller\ErrorController\getErrorHandlerFromSite(), TYPO3\CMS\Frontend\Controller\ErrorController\handleDefaultError(), and TYPO3\CMS\Frontend\Controller\ErrorController\isPageUnavailableHandlerConfigured().

◆ isPageUnavailableHandlerConfigured()

bool TYPO3\CMS\Frontend\Controller\ErrorController::isPageUnavailableHandlerConfigured ( )
protected

Checks whether the devIPMask matches the current visitor's IP address. Note: the name of this method is a misnomer (legacy code),

Returns
‪bool True if the server error handler should be used.

Definition at line 136 of file ErrorController.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Frontend\Controller\ErrorController\internalErrorAction(), and TYPO3\CMS\Frontend\Controller\ErrorController\unavailableAction().

◆ pageNotFoundAction()

ResponseInterface TYPO3\CMS\Frontend\Controller\ErrorController::pageNotFoundAction ( ServerRequestInterface  $request,
string  $message,
array  $reasons = [] 
)

Used for creating a 404 response ("Page Not Found"), but if configured, a RedirectResponse could be returned as well.

Parameters
ServerRequestInterface$request
string$message
array$reasons
Returns
‪ResponseInterface
Exceptions
PageNotFoundException

Definition at line 94 of file ErrorController.php.

References TYPO3\CMS\Frontend\Controller\ErrorController\getErrorHandlerFromSite(), and TYPO3\CMS\Frontend\Controller\ErrorController\handleDefaultError().

◆ unavailableAction()

ResponseInterface TYPO3\CMS\Frontend\Controller\ErrorController::unavailableAction ( ServerRequestInterface  $request,
string  $message,
array  $reasons = [] 
)

Used for creating a 503 response ("Service Unavailable"), to be used for maintenance mode or when the server is overloaded, a RedirectResponse could be returned as well.

Parameters
ServerRequestInterface$request
string$message
array$reasons
Returns
‪ResponseInterface
Exceptions
ServiceUnavailableException

Definition at line 72 of file ErrorController.php.

References TYPO3\CMS\Frontend\Controller\ErrorController\getErrorHandlerFromSite(), TYPO3\CMS\Frontend\Controller\ErrorController\handleDefaultError(), and TYPO3\CMS\Frontend\Controller\ErrorController\isPageUnavailableHandlerConfigured().