Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent
Allows to create a response for a thrown exception
Call setResponse() to set the response that will be returned for the
current request. The propagation of this event is stopped as soon as a
response is set.
You can also call setException() to replace the thrown exception. This
exception will be thrown if no response is set during processing of this
event.
- Author: Bernhard Schussek <bschussek@gmail.com>
Synopsis
class GetResponseForExceptionEvent
extends GetResponseEvent
{
- // members
- private Exception $exception;
- // methods
- public void __construct()
- public Exception getException()
- public void setException()
- // Inherited methods from GetResponseEvent
- public Response getResponse()
- public void setResponse()
- public Boolean hasResponse()
- // Inherited methods from KernelEvent
- public void __construct()
- public HttpKernelInterface getKernel()
- public Request getRequest()
- public integer getRequestType()
- // Inherited methods from Event
- public Boolean isPropagationStopped()
- public void stopPropagation()
- public void setDispatcher()
- public EventDispatcherInterface getDispatcher()
- public string getName()
- public void setName()
Hierarchy
Members
private
- $exception
—
\Exception
The exception object
Methods
public
- __construct()
- getException() — Returns the thrown exception
- setException() — Replaces the thrown exception
Inherited from Symfony\Component\HttpKernel\Event\GetResponseEvent
public
- getResponse() — Returns the response object
- hasResponse() — Returns whether a response was set
- setResponse() — Sets a response and stops event propagation
Inherited from Symfony\Component\HttpKernel\Event\KernelEvent
public
- getKernel() — Returns the kernel in which this event was thrown
- getRequest() — Returns the request the kernel is currently processing
- getRequestType() — Returns the request type the kernel is currently processing
Inherited from Symfony\Component\EventDispatcher\Event
public
- getDispatcher() — Returns the EventDispatcher that dispatches this Event
- getName() — Gets the event's name.
- isPropagationStopped() — Returns whether further event listeners should be triggered.
- setDispatcher() — Stores the EventDispatcher that dispatches this Event
- setName() — Sets the event's name property.
- stopPropagation() — Stops the propagation of the event to further event listeners.