Drupal 8  8.0.2
DefaultExceptionSubscriber Class Reference
Inheritance diagram for DefaultExceptionSubscriber:

Public Member Functions

 __construct (ConfigFactoryInterface $config_factory)
 
 onException (GetResponseForExceptionEvent $event)
 

Static Public Member Functions

static getSubscribedEvents ()
 

Protected Member Functions

 getErrorLevel ()
 
 onHtml (GetResponseForExceptionEvent $event)
 
 onJson (GetResponseForExceptionEvent $event)
 
 getFormat (Request $request)
 

Protected Attributes

 $errorLevel
 
 $configFactory
 

Detailed Description

Last-chance handler for exceptions.

This handler will catch any exceptions not caught elsewhere and report them as an error page.

Constructor & Destructor Documentation

__construct ( ConfigFactoryInterface  $config_factory)

Constructs a new DefaultExceptionSubscriber.

Parameters
\Drupal\Core\Config\ConfigFactoryInterface$config_factoryThe configuration factory.

References Drupal\configFactory().

Here is the call graph for this function:

Member Function Documentation

getErrorLevel ( )
protected

Gets the configured error level.

Returns
string

References Drupal\configFactory().

Referenced by DefaultExceptionSubscriber\onHtml().

Here is the call graph for this function:

Here is the caller graph for this function:

getFormat ( Request  $request)
protected

Gets the error-relevant format from the request.

Parameters
\Symfony\Component\HttpFoundation\Request$requestThe request object.
Returns
string The format as which to treat the exception.

References MainContentViewSubscriber\WRAPPER_FORMAT.

Referenced by DefaultExceptionSubscriber\onException().

Here is the caller graph for this function:

static getSubscribedEvents ( )
static

Registers the methods in this class that should be listeners.

Returns
array An array of event listener definitions.
onException ( GetResponseForExceptionEvent  $event)

Handles errors for this subscriber.

Parameters
\Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent$eventThe event to process.

References DefaultExceptionSubscriber\getFormat().

Here is the call graph for this function:

onHtml ( GetResponseForExceptionEvent  $event)
protected

Handles any exception as a generic error page for HTML.

Parameters
\Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent$eventThe event to process.

References Error\decodeException(), SafeMarkup\format(), Error\formatBacktrace(), DefaultExceptionSubscriber\getErrorLevel(), and t().

Here is the call graph for this function:

onJson ( GetResponseForExceptionEvent  $event)
protected

Handles any exception as a generic error page for JSON.

Todo:
This should probably check the error reporting level.
Parameters
\Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent$eventThe event to process.

References Error\decodeException().

Here is the call graph for this function:


The documentation for this class was generated from the following file: