CustomPageExceptionHtmlSubscriber
class CustomPageExceptionHtmlSubscriber extends DefaultExceptionHtmlSubscriber (View source)
Exception subscriber for handling core custom HTML error pages.
Properties
| protected HttpKernelInterface | $httpKernel | The HTTP kernel. |
from DefaultExceptionHtmlSubscriber |
| protected LoggerInterface | $logger | The logger instance. |
from DefaultExceptionHtmlSubscriber |
| protected RedirectDestinationInterface | $redirectDestination | The redirect destination service. |
from DefaultExceptionHtmlSubscriber |
| protected UrlMatcherInterface | $accessUnawareRouter | A router implementation which does not check access. |
from DefaultExceptionHtmlSubscriber |
| protected ConfigFactoryInterface | $configFactory | The configuration factory. |
|
| protected AccessManagerInterface | $accessManager | The access manager. |
Methods
Specifies the request formats this subscriber will respond to.
Specifies the priority of all listeners in this class.
Handles errors for this subscriber.
Registers the methods in this class that should be listeners.
Constructs a new CustomPageExceptionHtmlSubscriber.
Handles a 403 error for HTML.
Handles a 404 error for HTML.
Makes a subrequest to retrieve the default error page.
Makes a subrequest to retrieve the custom error page.
Details
protected array
getHandledFormats()
Specifies the request formats this subscriber will respond to.
static protected int
getPriority()
Specifies the priority of all listeners in this class.
The default priority is 1, which is very low. To have listeners that have a "first attempt" at handling exceptions return a higher priority.
onException(ExceptionEvent $event)
Handles errors for this subscriber.
static array
getSubscribedEvents()
Registers the methods in this class that should be listeners.
__construct(ConfigFactoryInterface $config_factory, HttpKernelInterface $http_kernel, LoggerInterface $logger, RedirectDestinationInterface $redirect_destination, UrlMatcherInterface $access_unaware_router, AccessManagerInterface $access_manager)
Constructs a new CustomPageExceptionHtmlSubscriber.
on4xx(ExceptionEvent $event)
Handles a 4xx error for HTML.
on401(ExceptionEvent $event)
Handles a 401 error for HTML.
on403(ExceptionEvent $event)
Handles a 403 error for HTML.
on404(ExceptionEvent $event)
Handles a 404 error for HTML.
protected
makeSubrequest(ExceptionEvent $event, string $url, int $status_code)
Makes a subrequest to retrieve the default error page.
protected
makeSubrequestToCustomPath(ExceptionEvent $event, string $custom_path, int $status_code)
Makes a subrequest to retrieve the custom error page.