‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Http\PropagateResponseException Class Reference
Inheritance diagram for TYPO3\CMS\Core\Http\PropagateResponseException:
TYPO3\CMS\Core\Http\ImmediateResponseException TYPO3\CMS\Core\Exception

Additional Inherited Members

- ‪Public Member Functions inherited from ‪TYPO3\CMS\Core\Http\ImmediateResponseException
 __construct (ResponseInterface $response, int $code=0)
 
Response getResponse ()
 

Detailed Description

Exception that has to be propagated back to the middleware stack in order to stop current execution and respond with the given response. This exception is used as alternative to previous die() or exit() calls.

Note this exception should be used in cases where a controller wants to create an 'early' response. An example are failed access checks: A controller wants to throw an early 'denied' response without further local processing.

When this exception is thrown by a controller, it will be caught by the 'very inner' ResponsePropagation middleware. The response is then returned to other 'outer' middlewares, allowing them to further operate on the response (eg. adding a content-length header) and to do other jobs (eg. releasing created locks).

If this exception is thrown within a middleware (as opposed to be thrown from within controllers), it will bypass other middlewares and will be caught just like the parent ImmediateResponseException. This should be used with care, there should be little reason to do so at all.

In general, from within controllers, this response exception should be preferred over ImmediateResponseException.

Definition at line 47 of file PropagateResponseException.php.