PHP Class Bolt\EventListener\ExceptionListener

Author: Gawain Lynch ([email protected])
Author: Carson Full ([email protected])
Inheritance: implements Symfony\Component\EventDispatcher\EventSubscriberInterface, implements Psr\Log\LoggerAwareInterface, use trait Psr\Log\LoggerAwareTrait, use trait Bolt\Request\ProfilerAwareTrait
Show file Open project: bolt/bolt

Protected Properties

Property Type Description
$exceptionController Bolt\Controller\Exception

Public Methods

Method Description
__construct ( Config $config, Exception $exceptionController, Psr\Log\LoggerInterface $logger ) Constructor.
getSubscribedEvents ( ) : array Return the events to subscribe to.
onBootException ( GetResponseForExceptionEvent $event ) Handle boot initialisation exceptions.
onKernelException ( GetResponseForExceptionEvent $event ) Handle errors thrown in the application.

Protected Methods

Method Description
isJsonRequest ( Request $request ) : boolean Checks if the request content type is JSON.

Method Details

__construct() public method

Constructor.
public __construct ( Config $config, Exception $exceptionController, Psr\Log\LoggerInterface $logger )
$config Bolt\Config
$exceptionController Bolt\Controller\Exception
$logger Psr\Log\LoggerInterface

getSubscribedEvents() public static method

Return the events to subscribe to.
public static getSubscribedEvents ( ) : array
return array

isJsonRequest() protected method

Checks if the request content type is JSON.
protected isJsonRequest ( Request $request ) : boolean
$request Symfony\Component\HttpFoundation\Request
return boolean

onBootException() public method

Handle boot initialisation exceptions.
public onBootException ( GetResponseForExceptionEvent $event )
$event Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent

onKernelException() public method

Handle errors thrown in the application.
public onKernelException ( GetResponseForExceptionEvent $event )
$event Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent

Property Details

$exceptionController protected property

protected Exception,Bolt\Controller $exceptionController
return Bolt\Controller\Exception