GetResponseForExceptionEvent
class GetResponseForExceptionEvent extends GetResponseEvent
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.
Methods
No description
Returns the thrown exception.
Mark the event as allowing a custom response code.
Returns true if the event allows a custom response code.
Details
stopPropagation()
Stops the propagation of the event to further event listeners.
If multiple event listeners are connected to the same event, no further event listener will be triggered once any trigger calls stopPropagation().
setException(Exception $exception)
Replaces the thrown exception.
This exception will be thrown if no response is set in the event.