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

Public Member Functions

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

Protected Member Functions

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

Detailed Description

Handles error requests, returns a response object.

Definition at line 37 of file ErrorController.php.

Member Function Documentation

◆ accessDeniedAction()

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.

Exceptions
PageNotFoundException

Definition at line 100 of file ErrorController.php.

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

◆ getErrorHandlerFromSite()

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

◆ handleDefaultError()

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

◆ internalErrorAction()

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

Used for creating a 500 response ("Internal Server Error"), usually due to some misconfiguration. If a page unavailable handler is configured, a RedirectResponse could be returned as well.

Exceptions
InternalServerErrorException

Definition at line 45 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 ( ServerRequestInterface  $request)
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 119 of file ErrorController.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\GeneralUtility\cmpIP().

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

◆ pageNotFoundAction()

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.

Exceptions
PageNotFoundException

Definition at line 81 of file ErrorController.php.

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

◆ unavailableAction()

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.

Exceptions
ServiceUnavailableException

Definition at line 63 of file ErrorController.php.

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