PHP Class Contao\CoreBundle\EventListener\PrettyErrorScreenListener

Show file Open project: contao/core-bundle Class Usage Examples

Public Methods

Method Description
__construct ( boolean $prettyErrorScreens, Twig_Environment $twig, Contao\CoreBundle\Framework\ContaoFrameworkInterface $framework, Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface $tokenStorage, Psr\Log\LoggerInterface $logger = null ) Constructor.
onKernelException ( GetResponseForExceptionEvent $event ) Map an exception to an error screen.

Private Methods

Method Description
getResponseFromPageHandler ( string $type ) : Response | null Returns the response of a Contao page handler.
getStatusCodeForException ( Exception $exception ) : integer Returns the status code for an exception.
getTemplateForException ( Exception $exception ) : string | null Maps an exception to a template.
getTemplateParameters ( string $view, integer $statusCode, GetResponseForExceptionEvent $event ) : array | null Returns the template parameters.
handleException ( GetResponseForExceptionEvent $event ) Handles the exception.
isBackendUser ( ) : boolean Checks if the user is a back end user.
loadLanguageStrings ( ) : array | null Loads the language strings.
logException ( Exception $exception ) Logs the exception.
renderBackendException ( GetResponseForExceptionEvent $event ) Renders a back end exception.
renderErrorScreenByException ( GetResponseForExceptionEvent $event ) Checks the exception chain for a known exception.
renderErrorScreenByType ( integer $type, GetResponseForExceptionEvent $event ) Renders the error screen.
renderTemplate ( string $template, integer $statusCode, GetResponseForExceptionEvent $event ) Renders a template and returns the response object.

Method Details

__construct() public method

Constructor.
public __construct ( boolean $prettyErrorScreens, Twig_Environment $twig, Contao\CoreBundle\Framework\ContaoFrameworkInterface $framework, Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface $tokenStorage, Psr\Log\LoggerInterface $logger = null )
$prettyErrorScreens boolean
$twig Twig_Environment
$framework Contao\CoreBundle\Framework\ContaoFrameworkInterface
$tokenStorage Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface
$logger Psr\Log\LoggerInterface

onKernelException() public method

Map an exception to an error screen.
public onKernelException ( GetResponseForExceptionEvent $event )
$event Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent